Summing up data from groups & pasting it another column

[Solved/Closed]
Report
Posts
3
Registration date
Tuesday March 12, 2013
Status
Member
Last seen
March 12, 2013
-
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
-
Hello there,

I need to write a macro for the following example:

A 2
A 3
A 3
B 4
B 1
B 4
C 7
D 3
D 8
Etc.

Basicallly i need to sum up group A, B, C, D, E etc. and have the result displayed in the third column in the same sheet like this:

A 2
A 3
A 3 8
B 4
B 1
B 4 9
C 7 7
D 3
D 8 11

Can anyone give me some pointers on how to achieve such a thing?
Thanks in advance

1 reply

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
let say
your letters are in column A, starting from row 1
and your numbers are in column B, starting from row 1

and you want sum to show in column C, then use this in cell C1 and copy down
=IF(COUNTIF(A:A,A1)=COUNTIF(A$1:A1,A1),SUMIF(A:A,A1,B:B),"")
2
Thank you

A few words of thanks would be greatly appreciated. Add comment

CCM 2821 users have said thank you to us this month

Posts
3
Registration date
Tuesday March 12, 2013
Status
Member
Last seen
March 12, 2013

I had to change the , into ; but when i did that it worked like a charm.

This made my day way easyer, thank you so much!

Edit: the code that worked for me was: =IF(COUNTIF(A:A;A1)=COUNTIF(A$1:A1;A1);SUMIF(A:A;A1;B:B);)
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
you are quite welcome