If statement using time of day

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
 
B

BAKERSMAN

Works great. Is there a way to have the cell be blank until the data is
entered for cell E2?
 
S

Sheeloo

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"))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top