ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   SUMIF with two or more variables (https://www.excelbanter.com/excel-worksheet-functions/162009-sumif-two-more-variables.html)

B Benton

SUMIF with two or more variables
 
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.


Peo Sjoblom

SUMIF with two or more variables
 
=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


--

Regards,

Peo Sjoblom




"B Benton" <B wrote in message
...
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.





All times are GMT +1. The time now is 12:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com