Multiple column array

J

Jim

I can get the following formula to work:
=SUMPRODUCT(--(Content!F2:Content!F475="Marcus"),--(Content!G2:Content!G475="need"),--(Content!M2:Content!M475="M4"),Content!L2:Content!L475)

But if I expand the "need" array like:
=SUMPRODUCT(--(Content!F2:Content!F475="Marcus"),--(Content!F2:Content!J475="need"),--(Content!M2:Content!M475="M4"),Content!L2:Content!L475)

It stops working. I would love to have the entire colums or set of columns in an array. How do I do that so that my formula works?

Thanks
Jim
 
J

Jim

I was able to get it to work by using this:
=SUM(SUMPRODUCT(--(Content!F2:F5000="Marcus"),--(Content!I2:I5000="need"),--(Content!M2:M5000="M4"),Content!L2:L5000))+(SUMPRODUCT(--(Content!F2:F5000="Marcus"),--(Content!H2:H5000="need"),--(Content!M2:M5000="M4"),Content!L2:L5000))+(SUMPRODUCT(--(Content!F2:F5000="Marcus"),--(Content!I2:I5000="need"),--(Content!M2:M5000="M4"),Content!L2:L5000))+(SUMPRODUCT(--(Content!F2:F5000="Marcus"),--(Content!J2:J5000="need"),--(Content!M2:M5000="M4"),Content!L2:L5000))

But there has to be a cleaner way! Any ideas?

Thanks
Jim
 
A

Aladin Akyurek

You have to switch from the native comma systax to the star syntax because
you mix vectors with a (multi-column) matrix:

=SUMPRODUCT((Content!F2:F475="Marcus")*(Content!F2:J475="need")*(Content!M2:
M475="M4")*Content!L2:L475)

Jim said:
I can get the following formula to work:
=SUMPRODUCT(--(Content!F2:Content!F475="Marcus"),--(Content!G2:Content!G475=
"need"),--(Content!M2:Content!M475="M4"),Content!L2:Content!L475)

But if I expand the "need" array like:
=SUMPRODUCT(--(Content!F2:Content!F475="Marcus"),--(Content!F2:Content!J475=
"need"),--(Content!M2:Content!M475="M4"),Content!L2:Content!L475)

It stops working. I would love to have the entire colums or set of
columns in an array. How do I do that so that my formula works?
 
J

Jim

Thanks!

Jim
--
Art Production Manager
Gas Powered Games


Aladin Akyurek said:
You have to switch from the native comma systax to the star syntax because
you mix vectors with a (multi-column) matrix:

=SUMPRODUCT((Content!F2:F475="Marcus")*(Content!F2:J475="need")*(Content!M2:
M475="M4")*Content!L2:L475)

Jim said:
I can get the following formula to work:
=SUMPRODUCT(--(Content!F2:Content!F475="Marcus"),--(Content!G2:Content!G475=
"need"),--(Content!M2:Content!M475="M4"),Content!L2:Content!L475)

But if I expand the "need" array like:
=SUMPRODUCT(--(Content!F2:Content!F475="Marcus"),--(Content!F2:Content!J475=
"need"),--(Content!M2:Content!M475="M4"),Content!L2:Content!L475)

It stops working. I would love to have the entire colums or set of
columns in an array. How do I do that so that my formula works?
 

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

Top