Adding corresponding column A values if values in column B match one another

1.8k Views Asked by At

I need to create a formula that adds up column A if the values in column B match.

A          B          
1        123    
1        123       
2        345       
2        345    
1        345

So for this example I need it to add up 123's to show 2 and 345's to show 5. I have been playing with SUMIF and VLOOKUP but haven't been able to get it to work.

1

There are 1 best solutions below

0
On

In row2 and copied down to suit:

=SUMIF(B:B,B2,A:A)