COUNTIF Date Falls within Date Range

DaVinciDecoder

New Member
Joined
Feb 22, 2017
Messages
6
Hi,

I'm attempting to count records at a specific MM/YYYY that fall within a date range that is organized into two columns, Start Date and End Date. Below, are a few examples:

Unique ID Start Date End Date
12345 6/1/2014 3/1/2015
54321 2/1/2014 5/1/2014
67890 6/1/2015 3/1/2017
09876 1/1/2014 3/1/2017

My summary page should look like the following:
Jan-14 Feb-14 Mar-14 Apr-14 May-14 June-14
1 2 2 2 2 3

Effectively, I'm trying to understand how many customers we had at a point in time. Thank you for the help.
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
I think you have an error in your expected output (based on your data sample). I only see 2 records for Jun-14.

So, let' say that your data is on a Sheet called "Data", and the dates are in columns B and C.
Let's say that your summary is on a Sheet called "Summary", and data start on row 2.
In cell A2, enter the date 1/1/2014, 2/1/2014 in cell A3, etc. Then format column A as "mmm-yy".
Now, in cell B2, enter this formula and copy down for all rows:
Code:
=COUNTIFS(Data!B:B,"<=" & A2,Data!C:C,">=" & A2)
That should give you what you want.
 
Upvote 0
This works perfectly! My Countifs formula looked like the following prior to your recommendation: =COUNTIFS(Data!B:B, ">="&A2, Data!C:C, "<="&A2); I now see why it wasn't returning the desired output. I appreciate your help and you're correct Jun-14 should only have 2 records.
 
Upvote 0

Forum statistics

Threads
1,223,270
Messages
6,171,102
Members
452,379
Latest member
IainTru

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