Sumproduct

P

Pete

When I enter the formula below, the result I get is 0, when it should
be 490

If Cells N5:N9,N22:N26,N39:N43 = A11

THEN SUM

D5:D9,D22:D26,D39:D43

=SUMPRODUCT(--(Sheet1!N5:N9=A11)--(Sheet1!D5:D9),--(Sheet1!N22:N26=A11),--(Sheet1!D22:D26),--(Sheet1!N39:N43=A11),--(Sheet1!D39:D43))

Any ideas?

Pete
 
B

Bob Phillips

=SUMPRODUCT(--(Sheet1!N5:N9=A11),Sheet1!D5:D9)+SUMPRODUCT(--(Sheet1!N22:N26=
A11),Sheet1!D22:D26)+SUMPRODUCT(--(Sheet1!N39:N43=A11),Sheet1!D39:D43)

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
K

Kassie

And also, do you want to sum D22:D26, as you state, or N22:N26, as per your
formula
 
B

bj

tr
=SUMPRODUCT(--(Sheet1!N5:N9=A11)*(Sheet1!D5:D9),--(Sheet1!N22:N26=A11)*(Sheet1!D22:D26),--(Sheet1!N39:N43=A11)*(Sheet1!D39:D43))

I am surprised you got zero for an answer, I am not surprised you did not
get the right answer.
in sumproduct each array separated by a "," is multiplied together
as such in your equation the first number would have been
[(1 or 0)+D5]*(1or0)*D22*(1 or 0)*D39 other combos similar.
most patterns would have given some value other than zero for a total of all
the combinations.

Please check if your D column actually has numbers and not numbers in text
format

if you just do = dum(D5:D9) what do you get?
 
A

Aladin Akyurek

Pete said:
When I enter the formula below, the result I get is 0, when it should
be 490

If Cells N5:N9,N22:N26,N39:N43 = A11

THEN SUM

D5:D9,D22:D26,D39:D43

=SUMPRODUCT(--(Sheet1!N5:N9=A11)--(Sheet1!D5:D9),--(Sheet1!N22:N26=A11),--(Sheet1!D22:D26),--(Sheet1!N39:N43=A11),--(Sheet1!D39:D43))

Any ideas?

Pete

=SUM(SUMIF(Sheet1!$N$5:$N$9,A11,Sheet1!$D$5:$D$9),
SUMIF(Sheet1!$N$22:$N$26,A11,Sheet1!$D$22:$D$26),
SUMIF(Sheet1!$N$39:$N$43,A11,Sheet1!$D$39:$D$43))
 
Top