Sumproduct syntax - more complex

M

Mitchell

I have a more complex sumproduct syntax problem
=SUMPRODUCT(--(Tasks!CI1:CI900="dduplessis"),--(Tasks!N1:N900<>"CUT"),--(OR((Tasks!CJ1:CJ900="New"),(Tasks!CJ1:CJ900="In
Progress"),(Tasks!CJ1:CJ900="In Progress - New"))),Tasks!CG1:CG900)

The equation worked fine, then I added the OR statement. The values for the
OR statement are all false, so the OR statement should be false. This means
the sumproduct should resolve to a 0, instead I am resolving to a #VALUE.
Where have I made an error?
 
B

Bob Phillips

=SUMPRODUCT(--(Tasks!CI1:CI900="dduplessis"),--(Tasks!N1:N900<>"CUT"),
--((Tasks!CJ1:CJ900="New")+(Tasks!CJ1:CJ900="In
Progress")+(Tasks!CJ1:CJ900="In Progress - New")),Tasks!CG1:CG900)

or

=SUMPRODUCT((Tasks!CI1:CI900="dduplessis")*(Tasks!N1:N900<>"CUT")*
((Tasks!CJ1:CJ900={"New","In Progress","In Progress -
New"}))*Tasks!CG1:CG900)

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
D

Domenic

Try...

=SUMPRODUCT(--(Tasks!CI1:CI900="dduplessis"),--(Tasks!N1:N900<>"CUT"),(Ta
sks!CJ1:CJ900="New")+(Tasks!CJ1:CJ900="In
Progress")+(Tasks!CJ1:CJ900="In Progress - New"),Tasks!CG1:CG900)

Hope this helps!
 
D

Domenic

Actually, I believe the following is more efficient...

=SUMPRODUCT(--(Tasks!CI1:CI900="dduplessis"),--(Tasks!N1:N900<>"CUT"),--I
SNUMBER(MATCH(Tasks!CJ1:CJ900,{"New","In Progress","In Progress -
New"},0)),Tasks!CG1:CG900)

or

=SUMPRODUCT(--(Tasks!CI1:CI900="dduplessis"),--(Tasks!N1:N900<>"CUT"),--I
SNUMBER(MATCH(Tasks!CJ1:CJ900,A2:A4,0)),Tasks!CG1:CG900)

....where A2:A4 contains New, In Progress, and In Progress - New.

Hope this helps!
 
M

Mitchell

Thanks, it worked perfectly

Bob Phillips said:
=SUMPRODUCT(--(Tasks!CI1:CI900="dduplessis"),--(Tasks!N1:N900<>"CUT"),
--((Tasks!CJ1:CJ900="New")+(Tasks!CJ1:CJ900="In
Progress")+(Tasks!CJ1:CJ900="In Progress - New")),Tasks!CG1:CG900)

or

=SUMPRODUCT((Tasks!CI1:CI900="dduplessis")*(Tasks!N1:N900<>"CUT")*
((Tasks!CJ1:CJ900={"New","In Progress","In Progress -
New"}))*Tasks!CG1:CG900)

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
Top