SUMPRODUCT and INDIRECT

J

JPDS

I'm having problems getting the following to work:

=SUMPRODUCT(--(INDIRECT($AW$3&"!$O$1:$O$6000")="XN01"),--(INDIRECT($AW$3&"!$BL$1:$BL$6000")={"A","B"}),(INDIRECT($AW$3&"!$CI$1:$CI$6000")))

The formula works when I only use one criteria in the range for $BL i.e.
{"A"}, but as soon as I add more than one criteria in, I get an error.

Thanks
 
E

Eduardo

Hi,
tr
=SUMPRODUCT(--(INDIRECT($AW$3&"!$O$1:$O$6000")="XN01"),--(INDIRECT($AW$3&"!$BL$1:$BL$6000")="A"),--(INDIRECT($AW$3&"!$BL$1:$BL$6000")="B"),(INDIRECT($AW$3&"!$CI$1:$CI$6000")))
 
A

Ashish Mathur

Hi,

Try this

=SUMPRODUCT((INDIRECT($AW$3&"!$O$1:$O$6000")="XN01")*(INDIRECT($AW$3&"!$BL$1:$BL$6000")="A"+(INDIRECT($AW$3&"!$BL$1:$BL$6000")="B"))*(INDIRECT($AW$3&"!$CI$1:$CI$6000")))

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com
 
D

Don Guillett

Try using a defined name for your ranges. Then
=SUMPRODUCT(--(rngO="XN01"),--(rngBL={"A","B"}),rngCL)
or
=SUMPRODUCT((rngO="XN01")*(rngBL={"A","B"})*rngCL)
 
J

JPDS

Would it matter if I told you that a person is an "A" OR "B"? Does your
calculation now try and determine if the person is both which is why it
brings back a zero?
 
B

Bob Phillips

Try

=SUMPRODUCT((INDIRECT($AW$3&"!$O$1:$O$6000")="XN01")
*(INDIRECT($AW$3&"!$BL$1:$BL$6000")={"A","B"})
*(INDIRECT($AW$3&"!$CI$1:$CI$6000")))
 
J

JPDS

HI Don, I cant use a range because I reference multiple monthly sheets which
is determined by the '$AW$3' part. Its getting quite tricky!
 
A

Ashish Mathur

Hi,

My formula works on OR (as desired). The + in the sumproduct implies an OR
condition. Could you kindly recheck

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top