Time comparison throws me

SandsB

Well-known Member
Joined
Feb 13, 2007
Messages
631
Column A has date.time in General format. Looks like this:
09/09/21 18:09
09/09/21 18:13
09/09/27 11:03
09/09/28 12:11
09/09/28 12:23
A2-A1 gets the time difference in column C, format is Time 37:30:55 and the result is correct so Excel's reading all this as the correct date and time. But
I need column D to show "Yes" if A2-A1 is greater than 10 minutes but less than 2 days. Blank if both conditions aren't met. Holy mole this is confusing.
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

SQUIDD

Well-known Member
Joined
Jan 2, 2009
Messages
1,971
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
UNTESTED

But does this work

=IF(AND(A2-A1>TIMEVALUE("00:10:00"),A2<A1+2),"yes","")
 

SandsB

Well-known Member
Joined
Feb 13, 2007
Messages
631
UNTESTED

But does this work

=IF(AND(A2-A1>TIMEVALUE("00:10:00"),A2<A1+2),"yes","")
When my feeble brain looks at this it says, yeah - that should work, but it only returns blanks.
 

SQUIDD

Well-known Member
Joined
Jan 2, 2009
Messages
1,971
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
Ok

Can i just ask, are you saying 2 days is 24 hours, or at this point are you just looking at the date only forgetting the time?

Dave
 

SQUIDD

Well-known Member
Joined
Jan 2, 2009
Messages
1,971
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows

ADVERTISEMENT

try

=IF(AND(A2-A1>TIMEVALUE("00:10:00"),A2-A1<2),"yes","")
 

SandsB

Well-known Member
Joined
Feb 13, 2007
Messages
631
try

=IF(AND(A2-A1>TIMEVALUE("00:10:00"),A2-A1<2),"yes","")
This works great. I still need to look at your original to see understand why it didn't work - seems logical to me. Thank for the help.
 

SQUIDD

Well-known Member
Joined
Jan 2, 2009
Messages
1,971
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
Great, glad that worked for you.
 
Learn Excel from Bill Jelen

Understanding data is crucial, and the easiest place to start is with Microsoft Excel.

Forum statistics

Threads
1,151,697
Messages
5,765,989
Members
425,321
Latest member
stefanov07

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
Top