formula question

P

Paula

what these two lines do in formula, please

=SUMPRODUCT(--($K$17:$K$200=O17)*--($G$17:$G$200="s"))

after SUMPRODUCT(--

after =017)*--

I use them for differant formula an they work, but i don't know what
they mean

ty
 
D

Dave Peterson

If the formula actually multiplies the factors (using the *), then the -- aren't
required.

=SUMPRODUCT(($K$17:$K$200=O17)*($G$17:$G$200="s"))
would be sufficient.

But if you wrote the formula as:
=SUMPRODUCT(--($K$17:$K$200=O17),--($G$17:$G$200="s"))
Then the first minus convert true/falses to -1/0.
The second converts them to +1/0.

Bob Phillips explains =sumproduct() in much more detail here:
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

And J.E. McGimpsey has some notes at:
http://mcgimpsey.com/excel/formulae/doubleneg.html
 

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