View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Glenn Glenn is offline
external usenet poster
 
Posts: 1,240
Default SUMPRODUCT and "--"

Bernd P wrote:
Bob Philips has a great page on SUMPRODUCT and double unaries '--'

He also has 2 ls in his surname, Welsh origins not Dutch <bg

Hello,

But he still does not show a SIGN() function around his example with
two OR criteria on that page <vbg

Compare
http://xldynamic.com/source/xld.SUMPRODUCT.html
[look for "=SUMPRODUCT((A1:A10="Ford")+(A1:A10="Renault" ))"]



Both ranges are the same and since the same cell can't equal both "Ford" and
"Renault", this will produce the expected result.


to
http://sulprobil.com/html/sumproduct.html
[look for "OR Condition"]



=SUMPRODUCT(SIGN(--(A1:A100<0)+(B1:B100=”YES”)),C1:C100)

Two distinct ranges. Since A1=-3 and B1="Yes" is possible, it is a different
problem requiring a more complex solution.


and judge yourself.



Both solutions appear to be valid, but one is more robust.


Regards,
Bernd