View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
dpb dpb is offline
external usenet poster
 
Posts: 109
Default Sum product formula with conditions

On 7/17/2019 3:20 PM, GS wrote:
On 7/17/2019 9:46 AM, TIMOTHY wrote:
Thank you Alan & Rover

I have searched on google and found out the formula

=sumproduct(--(Range1,criteria1),--(Range2,criteria2),Range3,Range4)


=sumproduct(num(Range1,criteria1),num(Range2,crite ria2),Range3,Range4)

I don't know who started this idiom of a double-negation operator
instead...but it's a least confusing to read if nothing else and seems
less efficient besides.


The double negative refs only negative values in the specified ranges.
In other uses it forces a negative value.


Not what I observed in the earlier cases wherein I was looking at how to
do some fairly complicated similar things...extensive testing appeared
to show it is simply what it is--a double negation that leaves the
result unchanged.

It was used by Klaus in his answers apparently to force a reference that
without Excel did not return values. NUM() is much cleaner for the purpose.

I'd surely be interested in seeing any reference that explains any other
interpretation for the syntax--I was unable to find it anywhere in the
documentation.

--