Consider this set:
A | B |
---|---|
YES | 1 |
NO | 3 |
NO | 3 |
NO | 2 |
NO | 5 |
YES | 2 |
YES | 1 |
I would like to create a formula that will choose all the values for "YES" from column 1, and for each match, add the values from column 2 (4).
I've attempted this using =SUM(VLOOKUP("YES",A1:B7, 2, FALSE) But this only returns the number of the first value found.
Any ideas how I can do this?
CodePudding user response:
Use SUMIFS:
=SUMIFS(B:B,A:A,"YES")