Sumproduct query

J

Jack Schitt

I have named ranges as follows:
Area refers to $C$11:$C$22
Option refers to $D$11:$D$22
Pessimistic refers to $E$11:$E$22

Formula
=SUMPRODUCT(Pessimistic*(Area=$C4)*(Option=$D4))
Returns the correct result, being the same as
=SUBTOTAL(9,Pessimistic)
after autofiltering database $C$11:$E$22 on Area set to value in C4 and
Option set to value in D4.

However, formula
=SUMPRODUCT(Pessimistic,Area=$C4,Option=$D4)
Returns value zero (not desired).

Could someone please tell me what is different about the logical process in
evaluating SUMPRODUCT function in each of the above cases? I understand the
process in the first case (multiplication separator) but clearly not the
second (comma separator).

Thanks
 
A

Arvi Laanemets

Hi

=SUMPRODUCT(Pessimistic,--(Area=$C4),--(Option=$D4))

Rem: -- forces logical expressions (TRUE/FALSE) to their numeric equivalents
(1 or 0).
Maybe you can use also
=SUMPRODUCT(Pessimistic,(Area=$C4)*1,(Option=$D4)*1)
, but I'm not entirely sure about it - havn't tested it in such setup.
 
F

Frank Kabel

Hi Arvi
the formula
=SUMPRODUCT(Pessimistic,(Area=$C4)*1,(Option=$D4)*1)

will work as will:
=SUMPRODUCT(Pessimistic,(Area=$C4)+0,(Option=$D4)+0)
or
=SUMPRODUCT(Pessimistic,(Area=$C4)^1,(Option=$D4)^1)
or even
=SUMPRODUCT(Pessimistic,N(Area=$C4),N(Option=$D4))

But I personally prefer the 'double minus' :)
 
A

Arvi Laanemets

Hi Frank


Frank Kabel said:
Hi Arvi
the formula
=SUMPRODUCT(Pessimistic,(Area=$C4)*1,(Option=$D4)*1)

will work as will:


I was almost sure about it.


Arvi Laanemets
 

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