Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 1
Default Need IF statement to categorize time into "Morning", "Afternoon", "Evening"

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?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,872
Default Need IF statement to categorize time into "Morning", "Afternoon", "Evening"

Hi,

Am Thu, 6 Jun 2013 16:06:21 +0100 schrieb JFi

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","Eve ning"))


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
  #3   Report Post  
Member
 
Posts: 93
Default

Hi

Another way would be the LOOKUP function:
=LOOKUP(A1,{"00:00","04:00","11:00","15:00"}+0,{"E vening","Morning","Afternoon","Evening"})

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

Quote:
Originally Posted by JFire View Post
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?

Last edited by Kevin@Radstock : June 8th 13 at 04:11 PM
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I need to display "Good Morning" or "Good Evening" based on NOW() Wesley Excel Worksheet Functions 7 April 24th 23 11:45 AM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM


All times are GMT +1. The time now is 12:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"