Kerzoz
Kerzoz

Reputation: 331

Microsoft Excel - How to calculate sum of a column based of two different columns as conditions

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

Answers (2)

John Joseph
John Joseph

Reputation: 1175

SUMIFS ... note the S. Couldn't be easier. :-) enter image description here

Upvotes: 1

ashleedawg
ashleedawg

Reputation: 21619

SUMIFS is a function for summing cells where multiple other ranges match certain crtieria.

In the case of your example:

example SUMIFS

=SUMIFS(C2:C7,A2:A7,4,B2:B7,"A")

...sums values in C2:C7 where A2:A7 = 4 and B2:B7 = "A".

More Information:

Upvotes: 1

Related Questions