Home > Software engineering >  vertical index match summation
vertical index match summation

Time:08-05

Sample Sheet

How can I get the summation of all the cells in column B given the value in column A. Let's say I want to get the summation of all the values in column B for value "1000" in column A.

Is this possible? What I've tried so far is using SUM, INDEX, and MATCH functions but I'm only able to get the first cell data.

SUM(INDEX(A1:B8, MATCH("1000",A1:A8, 0), 2))

Anyone who has some hints for me? Thanks!

CodePudding user response:

One should use SUMIFS (or its cousin SUMIF, which is slightly inferior):

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

CodePudding user response:

It's pretty simple:

For 1000: =SUMIF(A1:A8, "=1000", B1:B8)

For 2000: =SUMIF(A1:A8, "=2000", B1:B8)

That results in:

82.3

399.39

  • Related