Can you nest a SUMIF function?

S

Sho

I have the following formula

=sumif(b3:b7,"London",c3:c7)

I want to be able to sum based on different possibilities
so I tried the following formula but it did not work.

=sumif(b3:b7,"London",c3:c7,sumif
(b3:b7,"Manchester",E3:E7,sumif(b3:b7,"Aberdeen",D3:D7)))

Is it possible to nest SUMIF - or is there another way of
doing this? The problem is that what I wish to sum changes
depending on the criteria.

Any help would be great!
 
F

Frank Kabel

Hi
not possible with SUMIF (besides simply adding 3 SUMIF
statements) like
=SUMIF(b3:b7,"London",c3:c7)+SUMIF
(b3:b7,"Manchester",E3:E7)+SUMIF(b3:b7,"Aberdeen",D3:D7)
 
H

Harlan Grove

not possible with SUMIF (besides simply adding 3 SUMIF
statements) like
=SUMIF(b3:b7,"London",c3:c7)+SUMIF(b3:b7,"Manchester",E3:E7)
+SUMIF(b3:b7,"Aberdeen",D3:D7)
...

Since these criteria would be mutually exclusive (two or more could not be
satisfied in each row), this could be calculated using only 1 function call.

=SUMPRODUCT(--(B3:B7={"London","Aberdeen","Manchester"}),C3:E7)
 
A

Aladin Akyurek

=SUMPRODUCT(ISNUMBER(MATCH(B3:B7,{"London","Aberdeen","Manchester"},0))*C3:E
7)
 

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

Similar Threads


Top