1

Say that I have a spreadsheet with an indeterminate number of values in A, B, and C. I have a cell in column D that I want to increase by the value in cell Bx if the value in Ax matches some string. How can I do this? Here is an example spreadsheet below

A   |   B   |   C  |   D
Str    Int    Date  Total
Add     3     03/04   6
Ignore  4     03/04
Add     3     03/04   

See, the cell D2 adds B2 and B4, skipping B3 because the cell in A3 doesn't have the key text. I I add one more value with the correct text in A5, the value in B5 will be added.

A   |   B   |   C  |   D
Str    Int    Date  Total
Add     3     03/04   8
Ignore  4     03/04
Add     3     03/04   
Add     2     03/04 

What formula belongs in D2 to create this behavior?

1 Answer 1

1

Use SUMIF()

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

The First is the range to check for the criteria.

The Second is the criteria.

The Third is the matching range to sum when the criteria in the first range is met.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .