Reputation: 331
How do I SUM a set of value from a columns, with 2 different columns as a condition for the calculation?
Month Code Value
4 A 50
4 A 20
4 B 20
5 A 30
5 B 20
5 B 30
The desired outcome should be a SUM of Value
column that has the same Month
and Code
altogether:
Month Code SumValue
4 A 70
4 B 20
5 A 30
5 B 50
I tried using IF, but IF could only take 1 parameter as the condition, is there any built in function of Ms Excel that could help with this?
Thank you very much for any help in advance.
Upvotes: 2
Views: 319
Reputation: 21619
SUMIFS
is a function for summing cells where multiple other ranges match certain crtieria.
In the case of your example:
=SUMIFS(C2:C7,A2:A7,4,B2:B7,"A")
...sums values in C2:C7
where A2:A7 = 4
and B2:B7 = "A"
.
Office.com : Sum values based on multiple conditions
ExcelTrick : Excel SUMIF and SUMIFS – Explained
Upvotes: 1