SUMPRODUCT and/or

SaraWitch

Active Member
Joined
Sep 29, 2015
Messages
322
Office Version
  1. 365
Platform
  1. Windows
Hello Excel peeps.

I have a formula to add cases based on a couple of criteria. What I can't get the following formula to do is count if either "Drugs, substance misuse and/or drug dealing" or "Alchol related" are entered in the last column (N):

=SUMPRODUCT(--('ASB Cases 2021-22'!$C$6:$C$1002<H2),--('ASB Cases 2021-22'!$C$6:$C$1002>=F2),--('ASB Cases 2021-22'!$L$6:$L$1002="EBC"),--('ASB Cases 2021-22'!$M$6:$M$1002="High"),--('ASB Cases 2021-22'!$N$6:$N$1002="Drugs, substance misuse and/or drug dealing"),--('ASB Cases 2021-22'!$N$6:$N$1002="Alcohol related"))

It works if I do one or the other, but I need to count together if either are selected.

Any help would be appreciated.

Ta muchly!
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Sum the two conditions - this is how you should use an OR condition in SUMPRODUCT

=SUMPRODUCT(--('ASB Cases 2021-22'!$C$6:$C$1002<H2),--('ASB Cases 2021-22'!$C$6:$C$1002>=F2),--('ASB Cases 2021-22'!$L$6:$L$1002="EBC"),--('ASB Cases 2021-22'!$M$6:$M$1002="High"),('ASB Cases 2021-22'!$N$6:$N$1002="Drugs, substance misuse and/or drug dealing")+('ASB Cases 2021-22'!$N$6:$N$1002="Alcohol related"))

M.
 
Upvote 0
Solution

Forum statistics

Threads
1,215,429
Messages
6,124,838
Members
449,193
Latest member
MikeVol

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