Summing up data from groups & pasting it another column

Solved/Closed
V1R4L Posts 3 Registration date Tuesday 12 March 2013 Status Member Last seen 12 March 2013 - 12 Mar 2013 à 04:58
rizvisa1 Posts 4478 Registration date Thursday 28 January 2010 Status Contributor Last seen 5 May 2022 - 13 Mar 2013 à 06:36
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
Related:

1 response

rizvisa1 Posts 4478 Registration date Thursday 28 January 2010 Status Contributor Last seen 5 May 2022 766
12 Mar 2013 à 11:34
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),"")
V1R4L Posts 3 Registration date Tuesday 12 March 2013 Status Member Last seen 12 March 2013
12 Mar 2013 à 22:41
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);)
rizvisa1 Posts 4478 Registration date Thursday 28 January 2010 Status Contributor Last seen 5 May 2022 766
13 Mar 2013 à 06:36
you are quite welcome