If statement using time of day

  • Thread starter Thread starter BAKERSMAN
  • Start date Start date
B

BAKERSMAN

I need to have E2 return a specific value based on the time of day.

If E2 is greater than or equal to 0600 but less than 1800 then I need to see
shift 1
If E2 is greater than or equal to 1800 but less than 0600 then I need to see
shift 2
 
Works great. Is there a way to have the cell be blank until the data is
entered for cell E2?
 
Yes, add another IF to check for blanks. Try
=IF(E2="","",IF(AND(E2>=TIME(6,0,0),E2<TIME(18,0,0)),"Shift1","Shift2"))
 
Back
Top