IF and AND with Dates and Times

Francis85

New Member
Joined
Feb 26, 2014
Messages
8
Hello,

I work for a Transport company. We send notification to our customers as to when we will be delivering with a given window of 2.5 hours.

Our planned delivery date/time is (G3) 05/05/15 08:19
Our start window for this is (H3) 05/05/15 07:49
Our end window for this is (I3) 05/05/15 10:19
We actually arrived at (F3) 05/05/15 09:25

I would like a formula to show in cell (J3) 'IN TIME' if it is within this window.

I was thinking it was =IF(F3>=H3 and <=I3,"In Time","Late"), doesn't like it though. I've played with a few variations, but I cant think of another way round.
 
Last edited:

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Done it!!

I used; =IF(AND(F3>=H3,F3<=I3),"In Time","Late")

...and it is working. Thought I'd post in case anyone didn't have an answer and also would use this function.
 
Upvote 0
Thanks Gaz_chops, I must have just done it as you posted. I persisted a little longer. Very useful, thank you :)
 
Upvote 0
Yes, thank you. I'm now working on the results given.

If 'Late' then show how many HH:MM late compared to the 'Planned Date/Time'. Using; =IF(J3="Late",TEXT(F3-I3,"h:mm"))
 
Upvote 0
You shouldn't need the text part, try this and format cell as mm:ss, add what to do if not "Late" - ,"" at the end will return a blank.

=IF(J3="Late",(F3-I3),"")
 
Upvote 0
Okay sure, I'll try that.

I'm now having a problem with some of them.

Actual Dely Planned Dely Start Window End Window Difference Late by HH:MM
05/05/2015 12:37 05/05/2015 13:08 05/05/2015 12:38 05/05/2015 15:08 Late #VALUE!

The difference shouldn't show 'Late' as it is 1min early; formula in this cell is; =IF(AND(F381>=H381,F381<=I381),"In Time","Late")
 
Last edited:
Upvote 0
Because it was early! Realise you should should only check if it is greater than end window! So

=IF(F3<=I3,"In Time","Late")
 
Upvote 0
Brilliant! Thank you, I'm too concerned with being 'within' the window didn't think about that. This will work for me, you're a star :)
 
Upvote 0

Forum statistics

Threads
1,215,064
Messages
6,122,937
Members
449,094
Latest member
teemeren

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