Counting (COUNTIFS) based on two date criteria within 30 days of one another

HalpNeeded

New Member
Joined
May 4, 2022
Messages
6
Office Version
  1. 365
Platform
  1. Windows
Hello, first time poster here, though I've used the forums for many questions trying to resolve my excel stupidity.

I am hoping the collective wisdom can help me craft a formula to determine a COUNT of records.

I have a large data dump with thousands of records and I am trying count how many records are being "closed" within 30 days of them being opened.

These are in a large Table, with many other columns of data that I also filter by to narrow down the COUNT, but it is the date range criteria that is throwing me for a loop.
I have seen similar questions asked, but using TODAY()-30 as a way to determine the count, however, this is not something ran on the current day, but against historical data that is over 30 days old.

I apologize I cannot seem to get the mini-sheet addon working (whether computer or personal), so I will post an image instead.
My feeble attempt is shown in the screenshot and what my expected outcomes of the count (16) would be.

I am not sure how to place a table column as part of the criteria of the COUNTIFS statement without getting an error.

I appreciate any help figuring this out. Cheers.
 

Attachments

  • excelq1.png
    excelq1.png
    40.9 KB · Views: 39

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Hi & welcome to MrExcel.
How about
Excel Formula:
=SUM(--((B2:B19-A2:A19)<=30))
 
Upvote 0
Hello Fluff, thanks for responding so quickly!

The formula works, but giving me a result of 0.

I would have a 2nd question about that, can a SUM be nested within a COUNTIFS? I have multiple other criteria as well being used to narrow down by excluding some records.
 
Upvote 0
If you are getting a result of 0, then check that your dates are real dates & not text. Select the column & change the format to General, do you dates or numbers?
 
Upvote 0
Hello Fluff,

This is the result I get when converting to General.

Date/Time RequestedDate/Time Closed
44615.51209​
44615.53819
 
Upvote 0
In that case they are real dates, so the formula I suggested should work.
+Fluff 1.xlsm
ABCD
1
210/02/202222/02/202216
302/02/202211/02/2022
403/02/202212/02/2022
504/02/202213/02/2022
605/02/202214/04/2022
706/02/202215/02/2022
807/02/202216/02/2022
908/02/202217/02/2022
1009/02/202218/02/2022
1110/02/202219/02/2022
1211/02/202220/02/2022
1312/02/202221/04/2022
1413/02/202222/02/2022
1514/02/202223/02/2022
1615/02/202224/02/2022
1716/02/202225/02/2022
1817/02/202226/02/2022
1918/02/202227/02/2022
Lists
Cell Formulas
RangeFormula
D2D2=SUM(--((B2:B19-A2:A19)<=30))
 
Upvote 0
Solution
Fluff, thank you. It does work, I figured out what I did wrong with my original. I swapped the columns (A-B, instead of B-A).

I will see if I can work this into my COUNT or change the primary formula to the a SUM instead.

Thanks a lot!
 
Upvote 0
Glad to help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,162
Messages
6,170,432
Members
452,326
Latest member
johnshaji

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