Log in

View Full Version : SUMIF with 2 criteria


gilda102
Aug 1, 2008, 08:34 AM
Hello All,
I'm relatively new to using functions in excel and I'm sure my problem is really very simple but I am having a hard time figuring it out. I want to use the SUMIF function to total column C but only if column A=4012 and if column B=UK.

A B C
G/L Code Solic. Gift
4011 PE $100.00
4010 UK $75.00
4012 UK $200.00

I keep getting a #VALUE error when I try to add the second criteria.
Thanks for any help on this.

JBeaucaire
Aug 1, 2008, 10:26 AM
=SUMPRODUCT((A2:A100=4012)*(B2:B100="UK")*(C2:C100))

JBeaucaire
Aug 1, 2008, 10:31 AM
If the list is a growing list, you can NAME the data fields to make your formula easier to understand and self-adjust:

Highlight all the A column EXCEPT the title cell, then type PLCode in the Name box just above the A row. Repeat for the B row, except name it Solic. Name the C row Gift. Remember to NOT include the title row.

Now the formula can be changed to this and it reads like a sentence:

=SUMPRODUCT((PLCode=4012)*(Solic="UK")*(Gift))