Help Please with IF for dates

slinky192001

Board Regular
Joined
Mar 16, 2007
Messages
100
Hello,

I want to write and IF formula in Cell A1 which basically says,

if the date and time in cell B1 is equal to or greater than the date and time in C1 and less than or equal to the date and time in D1 then write 'On Time',
if the date and time in cell B1 Falls before the dates and times of cells C1 then write 'Early'
If the date and time in cell B1 falls after the dates and times of cells D1 then write 'Late'.

Can anyone assist me with this???
Thank you in advance

c
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

onlyadrafter

Well-known Member
Joined
Aug 19, 2003
Messages
5,703
Platform
  1. Windows
Hello,

does this give excpected results

=IF(B1 < C1,"Early",IF(B1 > D1,"Late","On Time"))

without the spaces
 
Last edited:
Upvote 0

TFCJamieFay

Active Member
Joined
Oct 3, 2007
Messages
480
Sorry about my typo, it should've read...

Code:
=IF(AND(B1>=C1,B1<=D1),"On Time",IF(B1<C1,"Early","Late"))

...but these guys seam to have it covered anyway!
 
Upvote 0

Forum statistics

Threads
1,195,960
Messages
6,012,566
Members
441,710
Latest member
needhelp_please

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