Add a column based on criteria from 2 other columns

  • Thread starter Thread starter cudan
  • Start date Start date
C

cudan

Column_A Column_B Column_C
2 75 250
2 75 500
3 76 350
4 70 1000

I want to add up column C, if column_A = 2 and column_B = 75. Can someone
help me out with this?

Thanks
 
Try this:

=SUMPRODUCT(--(A1:A4=2),--(B1:B4=75),C1:C4)

Better to use cells to hold the criteria:

E1 = 2
F1 = 75

=SUMPRODUCT(--(A1:A4=E1),--(B1:B4=F1),C1:C4)
 
Enter anywhere other than the sum range

=Sumproduct(--(a1:a100=2),--(b1:b100=75),(c1:c100))

Adjust 100 to the last row you want to include in your sum.
 
Try this:

=SUMPRODUCT((A1:A10=2)*(B1:B10=75),C1:C10)

Adjust ranges to suit your data.

Hope this helps.

Pete
 
Hi,

As an alternative, you can also use the following array formula
(Ctrl+Shift+Enter)

=sum(if((rangeA=2)*(rangeB=75),rangeC))

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com
 
Back
Top