Forum Discussion

ChelseaE's avatar
ChelseaE
Copper Contributor
Sep 23, 2020

Formula help: How to determine if one date range is within another date range

Hi everyone, I am trying to create a formula to determine if any days that fall within one date range, also fall within another/overlap any dates in the second range.

 

For example:

Date range 1: April 30, 2019 to March 31, 2020

Date range 2: March 29, 2020 to August 12, 2020

 

The answer would be that 3 days (March 29, 30 and 31) overlap. Does anyone know how to create a formula for this?

1 Reply

  • ChelseaE 

    Let's say the start and end of the first range are in B1 and C1, and the start and end of the second range in B2 and C2.

    The overlap is given by the formula

     

    =MAX(MIN(C2,C3)-MAX(B2,B3)+1,0)

     

    ā€ƒ

Resources