Sumif for groups and subgroups / Excel 2003

M

mwear

I'm trying to sum a row if it meets two different criteria. Here's an
example. Here I would try and add column C if column A was 123 and column B
was group A. Or something similar. I tried to used sumproduct (reading
other responses to similar questions) but I get #NUM! error. Any ideas?

A B C
1 123 group A 5
2 456 group D 10
3 123 group B 14
4 456 group A 7
5 123 group C 6
 
P

Pete_UK

It's always useful to post the formula you tried. Have a go with this
one:

=SUMPRODUCT((A1:A5=123)*(B1:B5="groupA")*(C1:C5))

If the first column contains text values rather than real numbers then
you will have to put the 123 in quotes, like this - "123"

You can't use complete columns (unless you have XL 2007).

Hope this helps.

Pete
 
M

mwear

Can I do this across different worksheets? My column A, B, and C would be on
one worksheet and my references and answer would be another. Because, if I
copy the table and your formula it works, but when I transfer it to what I
need, it still comes up with an error.

Thanks for the quick response!!
 
M

mwear

Instead of actually putting = 123, can I put in = F6 or something. Where in
F6 I would have 123? That's how I actually have it.

Here is what I actually have:
SUMPRODUCT(('[08 Profit Summary.xls]1st Purchaser'!$A$2:$A$407=B22)*('[08
Profit Summary.xls]1st Purchaser'!$C$2:$C$407=C22)*'[08 Profit
Summary.xls]1st Purchaser'!$J:$J)

Thanks for the prompt response.
 
S

Slugman_Brazil

Try
=sum(if(a1:a5="123", if(b1:b5="group A", c1:c5, 0), 0)) with Ctrl+Shift+Enter
 
M

Mike H

Yes you can do that. This formula can now go anywhere in the workbook and
look at values in sheet 3

=SUMPRODUCT((Sheet3!A1:A5=123)*(Sheet3!B1:B5="Group A")*(Sheet3!C1:C5))

Mike
 
M

mwear

I realized what I did. I forgot to limit the J column.

Thank you so much for your help.
 
M

mwear

Ah, yes. I figured it out. I had forgotten to limit the sum column.

Thanks so much for your help.
 

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