# SumIF multiple column criteria

1. ## SumIF multiple column criteria

Hi, looking to work a sum function with multiple match criteria. I.e., if column A = x and Column B = y, then sum Column C  Register To Reply

2. Maybe

=SUMPRODUCT((A1:A10="X")*(B1:B10="Y")*(C1:C10))
VBA Noob  Register To Reply

3. Hi, no sorry, not looking for a sumproduct. Here is what I have...

=SUMIF((AND(A1:A10="X",B1:B10="Y"),C1:C10)

where I'm looking to sum Column C for all rows that match the dual column criteria of A and B  Register To Reply

4. Originally Posted by gd19
Hi, no sorry, not looking for a sumproduct. Here is what I have...

=SUMIF((AND(A1:A10="X",B1:B10="Y"),C1:C10)

where I'm looking to sum Column C for all rows that match the dual column criteria of A and B
Unless I'm completely misunderstanding your requirement, that's precisely what VBA Noob's SUMPRODUCT() function gives you.

Why do you think it doesn't? This is the standard way of achieving a multi criteria 'SUMIF', which is something Microsoft in their infinite wisdom didn't cater for. Although it has to be said that SUMPRODUCT() is a pretty powerful general purpose solution for most of these sorts of requests. If you read around the subject you'll find that people have developed it in extremely clever ways that I guess Microsoft never even envisaged.

HTH  Register To Reply

5. Homework ??

Try this array (Ctrl + Shift + enter)

=SUM(IF(A1:A10="X",IF(B1:B10="y",C1:C10)))
VBA Noob  Register To Reply