COUNTIFS for Filtered Data, to Measure Date Ranges

ConnQuant

New Member
Joined
Oct 11, 2023
Messages
2
Office Version
  1. 365
Platform
  1. Windows
I have something i'm fairly stuck on in excel that i'm wondering if you know the cure for.

I have an original sheet with all of the con-evb data in it. I used that with a COUNTIF function on another tab to calculate a time series (Date of Approval for example) to take a week at a time and count how many jobs were approved between the Monday of that week and the following Sunday (including those dates). That all works great.

What I can't get is when I filter the original sheet by installer, or state, or however to filter it, the COUNTIF still counts all the data, even the hidden rows/filtered rows.

Now I was able to subtotal for regular counts, averages, sum, etc to take measurements of the filtered data, but I can't get the SUBTOTAL to account for filtered data between date ranges, thats where I'm stuck. I thought I was getting close with the SUMPRODUCT function but the need for counts between desired date ranges is messing up my equation. Most examples I see online are for people wanting to use countifs to see how many pears are the fruit of choice in a certain city of the country if you filter for just 15 lines of info that Jerry reviewed. I'm looking for something more specific to include date ranges that are then going to be filtered by company name. i know i could use a pivot table but thats not quite getting me what I want.
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
=SUMPRODUCT(SUBTOTAL(3,OFFSET('Con-EVB Pipeline'!$S$6:$S$6221,ROW('Con-EVB Pipeline'!$S$6:$S$6221)-MIN(ROW('Con-EVB Pipeline'!$S$6:$S$6221)),,1,)),N('Con-EVB Pipeline'!$S$6:$S$6221">=" & B18,'Con-EVB Pipeline'!$S$6:$S$6221,"<="& B17))

The B18 is 2/20/23 date and the B17 is 2/26/23 date. The regular COUNTIFS equation that works is =COUNTIFS('Con-EVB Pipeline'!$S$6:$S$6221,">=" & B18,'Con-EVB Pipeline'!$S$6:$S$6221,"<="& B17)
 
Upvote 0
Hi & welcome to MrExcel.
I would recommend using a helper column on the Con-EVB Pipeline with
Excel Formula:
=subtotal(3,A6)
Change the A6 to any column that will always have data.
Then you can just add another criteria to your countifs like
Excel Formula:
=COUNTIFS('Con-EVB Pipeline'!$S$6:$S$6221,">=" & B18,'Con-EVB Pipeline'!$S$6:$S$6221,"<="& B17,'Con-EVB Pipeline'!$T$6:$T$6221,1)
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,178
Members
452,615
Latest member
bogeys2birdies

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