How to sum up one column depending on two conditions?

T

tc

Hi

I've got a problem with the function in excel.
I want to sum up one column depending on two conditions.
eg. I want to sum up E1:E10 if A1:A10="condition1" and B1:B10="condition2"
I don't know how to do it. Do you have any idea?
I've tried sth like this:
=SUM(IF((A1:A10="condition1")*(B1:B10="condition2"),E1:E10))
but this don't work.


Thanks
luca
 
B

Bob Phillips

=SUMPRODUCT(--(A1:A10="condition1"),--(B1:B10="condition2"),E1:E10)

Your should have worked if you had array entered, Ctrl-Shift-Enter
 
T

tc

U¿ytkownik "Bob Phillips said:
=SUMPRODUCT(--(A1:A10="condition1"),--(B1:B10="condition2"),E1:E10)

Your should have worked if you had array entered, Ctrl-Shift-Enter

The problem is that when I press Ctrl-Shift-Enter excel returns a mistake,
and I can't find where.
 
T

tc

U¿ytkownik "Bob Phillips said:
=SUMPRODUCT(--(A1:A10="condition1"),--(B1:B10="condition2"),E1:E10)

Your should have worked if you had array entered, Ctrl-Shift-Enter

I don't know why but with yours is the same problem.

I've entered this function and excel returns a mistake, marks the comma
=SUMPRODUCT(--(A1:A10="condition1"),--(B1:B10="condition2"),E1:E10)
~~
and in my function, after pressing Ctrl-Shift-Enter, excel marks the comma
and E1 here:
=SUM(IF((A1:A10="condition1")*(B1:B10="condition2"),E1:E10))

~~~~

Do you have any idea why?

thanks
luca
 
F

Frank Kabel

Hi
first: No need toenter the sUMPRODUCT formula with
CTRL+SHIFT+ENTER. Simply hit ENTER.

Second: The error is probably caused by the use of the
coma. Your regional settings probably use the semicolon
instead as list separator. So try:
=SUMPRODUCT(--(A1:A10="condition1");--
(B1:B10="condition2");E1:E10)
 

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