SUMIF Sum a column subject to variables in two columns

S

Steve sivaD

Hi,

I already use the SUMIF function to calculate the total mileage for a
vehicle stored in columns A1:A50 if another column C1:C50 contains an 'x'.
However I now want to calculate the mileage if C1:C50 contains an 'x' and
column D1:D50 contains 'y'. I've looked at at various queries on this site re
SUMIF with 2 variable but none seem to give an answer on how to nest these
two conditione into the 'CRITERIA' part of the function. Please can anyone
help?
 
J

John C

SUMPRODUCT seems to be what you may be looking for:

=SUMPRODUCT(--(C1:C50="x"),--(D1:D50="y"),(A1:A50))
 
S

Shane Devenshire

Hi,

If you are using 2007 your formula would be

=SUMIFS(A1:A50,C1:C50,"x",D1:D50,"y")

No array necessary or sumproduct necessary

If this helps, please click the Yes button

Cheers,
Shane Devenshire
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top