Sumproduct not working

G

Guest

Read through many post. This seems to be the one I need but it is failing me.
I keep getting a sum of 0. It will work if remove all but one criteria,
anymore I get sum 0. The sum should be 6 Occurrences..................
"Wc"=2 "S"=2 "L"=1 "V"=1

What am I doing wrong?


=SUMPRODUCT(--(C4:AG4="S"),--(C4:AG4="L"),--(C4:AG4="V"),--(C4:AG4="WC"))
 
P

Peo Sjoblom

Your formula does not calculate OR S OR L etc, it calculates AND and thus
cannot return the correct answer

try

=SUMPRODUCT(--((C4:AG4="S")+(C4:AG4="L")+(C4:AG4="V")+(C4:AG4="WC")>0))

or

=SUMPRODUCT((C4:AG4="S")+(C4:AG4="L")+(C4:AG4="V")+(C4:AG4="WC"))


--


Regards,

Peo Sjoblom

Excel 95 - Excel 2007
Northwest Excel Solutions
www.nwexcelsolutions.com
(Remove ^^ from email)
 
G

Guest

Hi,

You need to use the sum instead of the the sumproduct.

{=SUM(--(C4:AG4="S"),--(C4:AG4="L"),--(C4:AG4="V"),--(C4:AG4="WC"))}

The sumproduct was multiplying the answers ie (010), (100), (001) = (000)
where as the sum adds them.

Don't forget it is an array formula. {}=Ctrl+Shft+Enter
 
D

Dave Peterson

And remember that this kind of thing will work, too:

=countif(c4:ag4,"s") + countif(c4:ag4,"l") + ....
 

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