Need IF statement to categorize time into "Morning", "Afternoon", "Evening"

J

JFire

I have a column of time stamps that I need to group into

- Morning: 4AM - 11AM
- Afternoon: 11:01AM - 3PM
- Evening: 3:01PM - 3:59AM

Can you help
 
C

Claus Busch

Hi,

Am Thu, 6 Jun 2013 16:06:21 +0100 schrieb JFire:
I have a column of time stamps that I need to group into

- Morning: 4AM - 11AM
- Afternoon: 11:01AM - 3PM
- Evening: 3:01PM - 3:59AM

try:
=IF(AND(A1>=TIME(4,,),A1<TIME(11,,)),"Morning",IF(AND(A1>=TIME(11,,),A1<TIME(15,,)),"Afternoon","Evening"))


Regards
Claus Busch
 
K

Kevin@Radstock

Hi

Another way would be the LOOKUP function:
=LOOKUP(A1,{0,0.1667,0.45833,0.625},{"Evening","Morning","Afternoon","Evening"})

You will have to remove the space after the "O" in morning as this sit
keeps on inserting the space for some reason!!!!
 

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