sumproduct or statement

blossomthe2nd

Active Member
Joined
Oct 11, 2010
Messages
450
Hi Guys

Im puling data from another spreadsheet that have the below columns

Date Area Type Product

I have a sumproduct that basically counts when the month of the date is equal to "Jan" and Area is equal to "Clothing" and Type is equal to "Summer" it looks a bit like the following

HTML:
=SUMPRODUCT(--(MONTH('[Customer 2012.xls]Customer'!$A$7:$A$31)=1),--('[Customer 2012.xls]Customer'!$B$7:$B$31="Clothing"),--('[Customer 2012.xls]Customer'!$C$7:$C$31="Summer"))

It works fine

But now I have to count when area is equal to either "Clothing" or "Groceries" or "Hardware"
I have amended formula to

HTML:
=sum((SUMPRODUCT(--(MONTH('[Customer 2012.xls]Customer'!$A$7:$A$31)=1),--('[Customer 2012.xls]Customer'!$B$7:$B$31="Clothing"),--('[Customer 2012.xls]Customer'!$C$7:$C$31="Summer"))),(SUMPRODUCT(--(MONTH('[Customer 2012.xls]Customer'!$A$7:$A$31)=1),--('[Customer 2012.xls]Customer'!$B$7:$B$31="Groceries"),--('[Customer 2012.xls]Customer'!$C$7:$C$31="Summer"))),(SUMPRODUCT(--(MONTH('[Customer 2012.xls]Customer'!$A$7:$A$31)=1),--('[Customer 2012.xls]Customer'!$B$7:$B$31="Hardware"),--('[Customer 2012.xls]Customer'!$C$7:$C$31="Summer")))

And although this works fine I anticipate my Boss adding more and more criteria and eventually I will get the "Formula too long error" -

Is it possible to have an OR Criteria as part of the sumproduct ??

Any suggestions greatly appreciated

Thanks

A
 
Last edited:

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Try

=SUMPRODUCT(--(MONTH('[Customer 2012.xls]Customer'!$A$7:$A$31)=1),--ISNUMBER(MATCH('[Customer 2012.xls]Customer'!$B$7:$B$31,{"Clothing","Groceries","Hardware"},0)),--('[Customer 2012.xls]Customer'!$C$7:$C$31="Summer"))
 
Upvote 0
Hi VoG

for the part thats ),--ISNUMBER(MATCH('[Customer 2012.xls]Customer'!$B$7:$B$31,{"Clothing","Groceries","Hardware"},0)),

Is it possible to use cell references instead of "clothing" "groceries" etc ?

Thanks

A
 
Upvote 0
Not as far as I know. To use cell addresses you'd need something like the formula that you posted.
 
Upvote 0

Forum statistics

Threads
1,203,615
Messages
6,056,307
Members
444,858
Latest member
ucbphd

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top