Search code examples
excelexcel-formula

Sum cells if values in other column are equal


I need a formula to sum all amounts where references from another column are the same. So:

Amount Reference SUM
100 1 2410
2300 1 2410
410 2 0
-410 2 0
10 1 2410
-100 3 -100

Tried to figure out a way with sumif, no luck.


Solution

  • Use simple SUMIFS() function.

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

    Or SUMIF().

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

    enter image description here