Date Range (A) within another data range (B)

Washc

New Member
Joined
Apr 22, 2020
Messages
7
Given these date ranges (A)

04/29/2020 05/12/2020 - 0
05/13/2020 05/26/2020 - 1
05/27/2020 06/09/2020 - 1
06/10/2020 06/23/2020 - 1
06/24/2020 07/07/2020 - 1
07/08/2020 07/21/2020 - 1
07/22/2020 08/04/2020 - 0

How can I found out if this range 5/24/2020 - 7/14/2020 (B) falls inside the ones above...
in essence, I should get a 1 when it does, and a 0 when it does not...

Many thanks in advance.
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Is completely within the range, or overlaps the range? The following formula shows how many days overlap in the ranges. If the overlap is the total length of the first range (rows 4-6), then it's completely within.

Book1
ABCDEFG
1StartEndOverlapStartEnd
24/29/20205/12/202005/24/20207/14/2020
35/13/20205/26/20203
45/27/20206/9/202014
56/10/20206/23/202014
66/24/20207/7/202014
77/8/20207/21/20207
87/22/20208/4/20200
97/22/20208/4/20200
Sheet8
Cell Formulas
RangeFormula
C2:C9C2=MAX(0,MIN(G$2,B2)-MAX(F$2,A2)+1)
 
Upvote 0
thank you very much for the help.. if you don't mind, what does the G$2 do (in contrast to just G2)?
 
Upvote 0
The $ sign makes it an absolute reference, as opposed to a relative reference. The way Excel works is that you can type in the formula in the C2 cell, then you can copy the cell and paste it to C3 and the range references without a $ will change relative to where you copied the formula from, to where to copied it to. So B2 and A2 changed to B3 and A3. If you put the $ sign on it, it does not change so G$2 and F$2 stay on row 2.
 
Upvote 0
that's cool!!! thank you.. I usually give ranges names to make it easier but this is pretty neat!! :)
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,370
Members
449,080
Latest member
Armadillos

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