Hi Nick

The double unary minus "--" coerces the TRUE or FALSE result of the
comparison inside the first set of brackets into 1's or 0's. This could also
be achieved by adding +0 or multiplying with a *1 addition to the formula
but doing a minus, minus (which comes back to the original value) is a
little faster in execution.

The resulting 1's and 0's then multiply the array from the second range and
Sumproduct adds the results to give the final answer.

So if the value in cell D1 were 100, that would be TRUE, and coerced to 1
would be multiplied by the value in F1 would result in the value in F1.
If D2 were not 100, then it would be FALSE hence 0 which multiplying by the
value in F2 would result in 0.


Regards

Roger Govier


thekovinc wrote:
> First off, I wasn't sure where to post this because I didn't know if the
> -- is classified as a worksheet function or not, but what does it do?
> I've seen them in a bunch of posts. I am just curious what they do.
>
> Example:
>
> =SUMPRODUCT(--($D$1:$D$100="100"),$F$1:$F$100)
>
> versus
>
> =SUMPRODUCT(($D$1:$D$100="100"),$F$1:$F$100)
>
> Why does the second one not work?
>
> Thanks,
> Nick
>
>