Time comparison throws me

SandsB

Well-known Member
Joined
Feb 13, 2007
Messages
705
Office Version
  1. 365
Platform
  1. Windows
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

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
UNTESTED

But does this work

=IF(AND(A2-A1>TIMEVALUE("00:10:00"),A2<A1+2),"yes","")
 
Upvote 0
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.
 
Upvote 0
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
 
Upvote 0
try

=IF(AND(A2-A1>TIMEVALUE("00:10:00"),A2-A1<2),"yes","")
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,214,923
Messages
6,122,289
Members
449,077
Latest member
Rkmenon

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