Forum Discussion

AaronL89's avatar
AaronL89
Copper Contributor
Sep 21, 2021

Checking if a time range falls between another time range

Good morning,

 

I'm looking for a formula to help me check if a time range falls between another time range, please see example table below:

 

ABCDEFG
DateTime FromTime ToEmployeeTime FromTime ToPresent?
9/09/202119:00 01:15John8:009:00 
9/09/202119:00 01:15Mary13:5015:30 
10/09/202120:00 00:30David10:2011:00 

 

In this example, I'd like G to return True/False based on if E and F falls between B and C

  • AaronL89  I'll throw an option in.  Sorry it isn't 'pretty'. Also it uses LET() so if you don't have Excel 365 I will have to modify it for the older formulas:

     

    =LET(a,B1,b,C1,c,E1,d,F1,bb,b+(b<a),dd,d+(d<c),AND(c<bb,dd>a))

     

    EDIT:

    actually the conversion is pretty simple:

    =AND(E1<(C1+(C1<B1)),(F1+(F1<E1))>B1)

     

Resources