Issue with CountIFS / SUMPRODUCT with multiple criteria

JayB0730

Board Regular
Joined
Oct 22, 2014
Messages
74
Office Version
  1. 365
Platform
  1. Windows
Hello,

I have an excel able that I am calculating count based on multiple criteria (Last Shipped Column & Status Column). So far the below formulas (1-4) work. However, I now I have to add a 3rd criteria and can't seem to get the formula's to work with either COUNTIFS or SUMPRODUCT.

The 3rd scenario is where Expiration Date (NonOptTBL[Expiration]) is either <= Today() or >Today() AND <=90.

1. Last shipped date is 1-30 days & status is NOT "I".
Code:
=COUNTIFS(NonOptTBL[Days Last Shipped],">"&0,NonOptTBL[Days Last Shipped],"<="&30,NonOptTBL[Status],"<>"&"I")

2. Last shipped date is 31-60 days & status is NOT "I".
Code:
=COUNTIFS(NonOptTBL[Days Last Shipped],">"&30,NonOptTBL[Days Last Shipped],"<="&60,NonOptTBL[Status],"<>"&"I")

3. Last shipped date is 61-90 days & status is NOT "I".
Code:
=COUNTIFS(NonOptTBL[Days Last Shipped],">"&60,NonOptTBL[Days Last Shipped],"<="&90,NonOptTBL[Status],"<>"&"I")

4. Last shipped date is GREATER than 90 days OR No Delivery Date is present & status is NOT "I".
Code:
=(SUMPRODUCT((NonOptTBL[Days Last Shipped]>90)*(NonOptTBL[Status]<>"I")))+SUMPRODUCT((NonOptTBL[Days Last Shipped]=0)*(NonOptTBL[Status]<>"I"))

TIA.
Jay
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
I think the 3rd scenario can be simplified to
NonOptTBL[Expiration]<=TODAY()+90

Am i right?

M.
 
Upvote 0
Hi Marcelo,

Hmm you may be right. But how would I be able to include that 3rd scenario and let's say introduce 4,5,6, etc. scenarios? I feel stuck especially with formula #4 .
 
Upvote 0
According to post 1, the criteria for formula 4 are
Last shipped date is GREATER than 90 days OR No Delivery Date is present & status is NOT "I".

I'm supposing you mean
(Days Last Shipped>90 Or Days Last Shipped=0) AND Status<>"I"

If so maybe something like this
=SUMPRODUCT(--((NonOptTBL[Days Last Shipped]=0)+(NonOptTBL[Days Last Shipped]>90)),--(NonOptTBL[Status]<>"I"))

To use an OR condition in an array formula you should add the two conditions.

M.
 
Upvote 0

Forum statistics

Threads
1,223,240
Messages
6,170,951
Members
452,368
Latest member
jayp2104

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