SUMIF with two or more variables

G

Guest

I am trying to use the SUMIF function with two variables.
What I have is a worksheet with multiple columns. Let's say columns A and B
have data (names) and column C has numbers. What I want to do is check for
criteria in columns A and B and add column C if they match.

Job Skill Type Hours
abc wri 3
xyz wri 2
abc ill 3
xyz wri 5
abc wri 3

On a seperate worksheet in the same workbook I want it to determine the
total hours that "abc" worked "wri" only.
I have tried to imbed an AND function as part of the SUMIF function but
can't get it to work.
 
P

Peo Sjoblom

=SUMPRODUCT(--(A2:A10="abc"),--(B2:B10="wri"),C2:C10)

for better usability replace abc and wri with cell references

=SUMPRODUCT(--(A2:A10=D2),--(B2:B10=E2),C2:C10)

then instead of editing the formula when you want to change names just
change the contents of D2 and E2
 

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