Thread
:
sumproduct bombs out
View Single Post
#
16
Sandy Mann
Posts: n/a
Thank you Aladin, I thought that you had missed my post
--
Sandy
Replace@mailinator with @tiscali.co.uk
"Aladin Akyurek" wrote in message
...
Your analysis looks correct to me. If you have more conditions to OR, it
pays of to switch to the IsNumer/Match idiom.
Sandy Mann wrote:
Anyone?
--
Sandy
Replace@mailinator with @tiscali.co.uk
"Sandy Mann" wrote in message
...
Aladin,
"Aladin Akyurek" wrote in message
. ..
Remember that...
($E$157:$E$5105={"LAN","PFT","PF"})
is not an efficient idiom.
Can you verify, (or correct me if I am wrong), that the reason that you
say
that it is an *inefficient idiom* is because, using the OP's original
data
and formula:
COL A COL B COL C
PF LAN 0
PF PFT 1
=SUMPRODUCT((A1:A2="PF")*(B1:B2={"LAN","PFT"})*( C1:C2))
(A1:A2="PF") evauates to TRUE;TRUE but (B1:B2={"LAN","PFT"}) evaluates
to
TRUE,FALSE;FALSE,TRUE so the (A1:A2="PF") has to be evaluated twice to
match the (B1:B2={"LAN","PFT"}) whereas in
=SUMPRODUCT((A1:A2="PF")*((B1:B2="LAN")+(B1:B2=" PFT"))*(C1:C2))
(A1:A2="PF") only gets evaluated once although B1:B2 still gets
evaluated
twice, but then it was being evaluated twice anyway.
--
Sandy
Replace@mailinator with @tiscali.co.uk
.
--
[1] The SumProduct function should implicitly coerce the truth values to
their Excel numeric equivalents.
[2] The lookup functions should have an optional argument for the return
value, defaulting to #N/A in its absence.
Reply With Quote