SumProduct: multiple variables and skip when criteria does not match

KP_SoCal

Board Regular
Joined
Nov 17, 2009
Messages
116
I’m struggling to come up with a solution for this. I have two questions which I will create separate posts for. For this post, here’s the formula I’m working with:

=SUMPRODUCT((AllocatedVeh!$A$2:$A$65000=Manifest!C8)*(AllocatedVeh!$C$2:$C$65000=Manifest!D8)*(AllocatedVeh!$F$2:$F$65000=Manifest!G8)*(AllocatedVeh!$I$2:$I$65000))

I need my SUMPRODUCT function formula to SKIP criteria in certain instances. For instance, if Manifest!C8 = “TEXTILE”, I want to skip (AllocatedVeh!$A$2:$A$65000=Manifest!C8) as being a part of the criteria in summing (AllocatedVeh!$I$2:$I$65000).

I hope this makes sense. Thanks so much for any help you can provide! :)
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Does this do the trick?

Code:
=SUMPRODUCT(--(AllocatedVeh!$A$2:$A$65000<>"TEXTILE"),--(AllocatedVeh!$A$2:$A$65000=Manifest!C8),--(AllocatedVeh!$C$2:$C$65000=Manifest!D8),--(AllocatedVeh!$F$2:$F$65000=Manifest!G8),(AllocatedVeh!$I$2:$I$65000))

By the way - do you really need to reference 65,000 rows?
 
Last edited:
Upvote 0
No, this does not accomplish what I'm looking for. I still need to reference Manifest!C8 for instances when Manifest!C8 <> "Textile" then include this criteria in the formula, but when it is equal to "Textile", I want it to skip this criteria and move on to the next criteria in the formula.

I think the answer maybe within the "MATCH" function, but I don't have much experience with using it, especially within a SUMPRODUCT formula. I searched other forums for this, but am still coming up short.

Any other sugguestions???
 
Upvote 0
How about:

Code:
=IF(Manifest!C8="Textile",SUMPRODUCT((AllocatedVeh!$C$2:$C$65000=Manifest!D8)*(AllocatedVeh!$F$2:$F$65000=Manifest!G8)*(AllocatedVeh!$I$2:$I$65000)),SUMPRODUCT((AllocatedVeh!$A$2:$A$65000=Manifest!C8)*(AllocatedVeh!$C$2:$C$65000=Manifest!D8)*(AllocatedVeh!$F$2:$F$65000=Manifest!G8)*(AllocatedVeh!$I$2:$I$65000))

You may have to tweak the () a bit, but basically it's an "IF" function that doesn't have the "SUMPRODUCT((AllocatedVeh!$A$2:$A$65000=Manifest!C8)" if Manifest!C8 = "Textile"

Is that what you had in mind?
 
Upvote 0
I’m struggling to come up with a solution for this. I have two questions which I will create separate posts for. For this post, here’s the formula I’m working with:

=SUMPRODUCT((AllocatedVeh!$A$2:$A$65000=Manifest!C8)*(AllocatedVeh!$C$2:$C$65000=Manifest!D8)*(AllocatedVeh!$F$2:$F$65000=Manifest!G8)*(AllocatedVeh!$I$2:$I$65000))

I need my SUMPRODUCT function formula to SKIP criteria in certain instances. For instance, if Manifest!C8 = “TEXTILE”, I want to skip (AllocatedVeh!$A$2:$A$65000=Manifest!C8) as being a part of the criteria in summing (AllocatedVeh!$I$2:$I$65000).

I hope this makes sense. Thanks so much for any help you can provide! :)

Try...

Rich (BB code):
=SUMPRODUCT(
   --(AllocatedVeh!$A$2:$A$65000=
        IF(Manifest!C8 = “TEXTILE”,AllocatedVeh!$A$2:$A$65000,Manifest!C8),
   --(AllocatedVeh!$C$2:$C$65000=Manifest!D8),
   --(AllocatedVeh!$F$2:$F$65000=Manifest!G8)
   AllocatedVeh!$I$2:$I$65000)


 
Upvote 0

Forum statistics

Threads
1,214,792
Messages
6,121,612
Members
449,038
Latest member
apwr

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