TIME and IF function

M

Mediaexcel

I am trying to categorize some of my data by time segments
i.e.

6PM-12AM = EVENING
12AM-6AM = NIGHT
6AM-12PM = MORNING
12PM-6PM = AFTERNOON

Column A would have the exact time and column be would have one of th
four categories.

I previously used the follwing formula but can't figure out how to ad
two more variables.

=IF(AND(E122<TIME(23, 59, 59),E122>TIME(18, 0, 0)),"EVENING","OTHER")

Thank yo
 
J

JE McGimpsey

Since XL stores times as fractional days (e.g., 3:00 = 0.125):

=CHOOSE(INT(A1*4)+1,"NIGHT","MORNING","AFTERNOON","EVENING")
 

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