Sumif with 2 ranges & 2 criteria

C

cgibby

Hi, I have been trying to figure out a way to use the sumif with 2 criteria &
2 ranges...here is what it looks like
Name Job Name Class Amount
Lee Bolding Const Lot 27 Labor 1000
Tom Moran lot 25 Labor 5000
Seneca Hardwood lot 27 materials 2000

I want a formula that gives me the total amount of all job names containing
"lot 27" in which contain the class "labor". I have been able to get the
total amount of just lot 27, but not 2 different criteria.
Can you help?
 
C

cgibby

I don't know why, but it doesn't work...it just gave me "#Name?" - maybe it's
because i don't understand the sumproduct function and how it works...is
there no way to do it with the sumif function?
 
J

JE McGimpsey

It's probably because you don't have your options set to use row and
column labels. Try

=SUMPRODUCT(--(B2:B4="Lot 27"),--(C2:C6="Labor"),D2:D6)
 
C

cgibby

Ok I got that to work, thanks you!
i have another question though. I tried using
(--($B:$B="Lot 27"),(--($C:$C="Labor"),$D:$D) to add all of the columns,
but it didn't work. is there a reason why i can't do the "$"
 
J

JE McGimpsey

Prior to XL07, array formulae (which SUMPRODUCTs are, even though they
don't need to be entered with CTRL-SHIFT-ENTER) don't accept entire
columns as arguments.

You could use something like:

--($B$1:$B65535="Lot 27")
 
C

cgibby

ok thanks so much for your help!

JE McGimpsey said:
Prior to XL07, array formulae (which SUMPRODUCTs are, even though they
don't need to be entered with CTRL-SHIFT-ENTER) don't accept entire
columns as arguments.

You could use something like:

--($B$1:$B65535="Lot 27")
 

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