Check if Date Ranges falls within Specific Dates

Siops

Board Regular
Joined
Sep 8, 2011
Messages
80
Good day. I would like to ask some help on how can I determine if the date ranges are falls within the specific dates? Thank you in advance.

[TABLE="width: 128"]
<tbody>[TR]
[TD="width: 64"]Date From[/TD]
[TD="width: 64"]Date To[/TD]
[/TR]
[TR]
[TD]08/31/2018[/TD]
[TD]09/01/2018[/TD]
[/TR]
[TR]
[TD]08/30/2018[/TD]
[TD]09/05/2018[/TD]
[/TR]
[TR]
[TD]12/21/2018[/TD]
[TD]12/23/2018[/TD]
[/TR]
[TR]
[TD]12/23/2018[/TD]
[TD]12/27/2018[/TD]
[/TR]
</tbody>[/TABLE]

List of Specific Dates:
  • 09/04/2018
  • 12/24/2018
  • 12/25/2018
 
Last edited:
Let's say that your data ranges are in cells A2:B5, and the date you are searching on is in cell E1.
Then this formula will tell you whether the date in cell E1 falls within one of those ranges.
Code:
=IF(COUNTIFS(A2:A5,"<="&E1,B2:B5,">="&E1)>0,"Yes","No")
 
Upvote 0
Thanks, Joe for the quick reply but it should be the other way around. I'm checking if the date range from A2:B2 covers the list of dates in E:E
 
Upvote 0
If you are checking record-by-record like that, it would just be something like:
Code:
=IF(AND(A2<=E1,B2>=E1),"Yes","No")
 
Upvote 0
Appreciate your quick response, Joe. But is it also possible if the dates in the E column are list of dates?
 
Upvote 0
But is it also possible if the dates in the E column are list of dates?
I am not sure what you mean.

How about this, based on the example you posted above, show us what you want your results to look like.
Then we should be able to clearly see exactly what you expect.
 
Upvote 0
[TABLE="width: 442"]
<tbody>[TR]
[TD]Date From[/TD]
[TD]Date To[/TD]
[TD]Within Holiday?[/TD]
[TD][/TD]
[TD="align: left"]List of Holidays[/TD]
[/TR]
[TR]
[TD]8/31/2018[/TD]
[TD]9/1/2018[/TD]
[TD]No[/TD]
[TD][/TD]
[TD="align: right"]9/4/2018[/TD]
[/TR]
[TR]
[TD]8/30/2018[/TD]
[TD]9/5/2018[/TD]
[TD]Yes[/TD]
[TD][/TD]
[TD="align: right"]12/24/2018[/TD]
[/TR]
[TR]
[TD]12/21/2018[/TD]
[TD]12/23/2018[/TD]
[TD]No[/TD]
[TD][/TD]
[TD="align: right"]12/25/2018[/TD]
[/TR]
[TR]
[TD]12/23/2018[/TD]
[TD]12/27/2018[/TD]
[TD]Yes[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
OK, its really just the first solution I posted, switched around.
So if the dates are in A2:B5, and the Holidays are in cells E2:E4, enter this formula in C2 and copy down to C5:
Code:
=IF(COUNTIFS(E$2:E$4,">="&A2,E$2:E$4,"<="&B2)>0,"Yes","No")
 
Upvote 0

Excel 2010
ABCDE
1Date FromDate To4-Sep-1824-Dec-1825-Dec-18
231-Aug-181-Sep-18FALSEFALSEFALSE
330-Aug-185-Sep-18TRUEFALSEFALSE
421-Dec-1823-Dec-18FALSEFALSEFALSE
523-Dec-1827-Dec-18FALSETRUETRUE
6
7
8Within rangeTRUETRUETRUE
9orWithin rangeTRUETRUETRUE
10
8a
Cell Formulas
RangeFormula
C2=AND(C$1>=$A2,C$1<=$B2)
C8=COUNTIF(C2:C5,TRUE)>0
C9=COUNTIFS($A$2:$A$5,"<="&C1,$B$2:$B$5,">="&C1)>0
 
Upvote 0

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