View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rick Rothstein \(MVP - VB\) Rick Rothstein \(MVP - VB\) is offline
external usenet poster
 
Posts: 2,202
Default SUMPRODUCT with )--

Two unary minus signs is the same as a plus sign, but affixing a plus sign
to an expression does not force a calculation to take place. When no
calculations are being done to a logical expressions (or a number that is
being returned as text), the double unary forces a calculation (minus one
times minus one times the TRUE or FALSE returned by the logical expression)
to take place... that is why it is used. The first argument in the
SUMPRODUCT function in the formula you posted does, in fact, have a
calculation taking place, so the double unary minus signs are unnecessary.
This should return the same thing your formula does...

=SUMPRODUCT((ProblemClosedDate=$B21)+(ActionClose dDate=$C21),--(ProblemClosedDate<""),--(ProblemOpenDate<$F20),--(LOB=$E21),--(DueDateVersion$D21))

although I have to admit that looks like an odd construction to me. Are you
sure there is not missing comma between the first two arguments of the
SUMPRODUCT function in the formula as you originally posted it?

Rick


"Paul Dennis" wrote in message
...
As an example I have
=SUMPRODUCT(--(ProblemClosedDate=$B21)--(ActionClosedDate=$C21),--(ProblemClosedDate<""),--(ProblemOpenDate<$F20),--(LOB=$E21),--(DueDateVersion$D21))
and it returns 21. I have checked my numbers and the result matches what I
want. If I however add a comma after the first criteria then it returns 0
which is incorrect.

My initial though was the , changed the criteria from an additional filter
to an and i.e. both the criteria had to match.

"Peo Sjoblom" wrote:

If you use the unary minuses you would always need a comma as a delimiter
so
your second example is wrong. You can also use

sumproduct((.....)*(....))

http://www.mcgimpsey.com/excel/formulae/doubleneg.html


--


Regards,


Peo Sjoblom


"Paul Dennis" wrote in message
...
Hi,

I know what -- does however I have seen it a couple of ways, syntax
sumproduct(--(criteria),--(criteria)) and also
sumproduct(--(criteria)--(criteria))

what is the difference in using the , or not?

thx