Thread: double unary
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
s2m via OfficeKB.com s2m via OfficeKB.com is offline
external usenet poster
 
Posts: 30
Default double unary

=SUMPRODUCT(--(Odyssey!$AH$2:$AH$999={"N","U"}),

is the same as a or statement?




Bob Phillips wrote:
Who knows why you used it? I certainly don't (well actually I do, but it is
not necessary (see later).

I quote from that article, ...

There is no situation that I know of whereby a solution using -- could not
be achieved somehow with a '*'. Conversely, if using the TRANSPOSE function
within SUMPRODUCT, then the '*' has to be used.

In your formula, -- would have worked where you have *,. As written, * would
not have worked where you use --, because of the OR (+) condition, but just
by wrapping extra brackets around the OR conditions, you could have used *.
IMO, the worst you can do is mix them.

You could even get rid of the + with

=SUMPRODUCT(--(Odyssey!$AH$2:$AH$999={"N","U"}),
--(Odyssey!$AM$2:$AM$999<""),
--(Odyssey!$AX$2:$AX$999=DATE(2006,7,1))*(Odyssey!$ AX$2:$AX$999<=DATE(2006,
7,31)))

Thank you to who ever suggested this site
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

[quoted text clipped - 9 lines]

=SUMPRODUCT(--(Odyssey!$AH$2:$AH$999="N")+(Odyssey!$AH$2:$AH$999 ="U"),--


(Odyssey!$AM$2:$AM$999<"")*(Odyssey!$AX$2:$AX$99 9=DATE(2006,7,1))*(Odyssey
!
$AX$2:$AX$999<=DATE(2006,7,31)))

I am getting the correct results I just want to understand why I used *
between the dates and + between N and U and -- and the start of the formula.

Thanks again


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200608/1