#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22
Default Formula

Dear All

I have a worksheet which has a start time and an end time for visits
throughout the week, Some lines however are blank

I want a formula which tells me if the end of the visit is before 9.30 am to
return "morning", if its before 17:00 then return "Afternoon", if its before
23:30 return "Evening" and if its blank return "Ignore"

Could anyone help me please ?

D

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200810/1

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,345
Default Formula

There seems to be some *holes* in your requirements like what if the end
time is after 9:30am but before 12 noon? and what if it is after 23:30?

=IF(B1<=9.5/24,"Morning",IF(B1<=17/24,"Afternoon",IF(B1<23.5/24,"Evening","Nighshift?")))

If there will never be any ent time after 23:30 then you can cut it down to:

=IF(B1<=9.5/24,"Morning",IF(B1<=17/24,"Afternoon","Evening"))

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"dazoloko via OfficeKB.com" <u43760@uwe wrote in message
news:8b9ba69d3ea41@uwe...
Dear All

I have a worksheet which has a start time and an end time for visits
throughout the week, Some lines however are blank

I want a formula which tells me if the end of the visit is before 9.30 am
to
return "morning", if its before 17:00 then return "Afternoon", if its
before
23:30 return "Evening" and if its blank return "Ignore"

Could anyone help me please ?

D

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200810/1




  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default Formula

=IF(A2<TIME(9,30,),"morning",IF(A2<TIME(17,,),"Aft ernoon",IF(A2<TIME(23,30,),"Evening",IF(A2="","Ign ore","After
evening"))))
I am assuming that your cells contain just a time, not a date and time. If
the latter, replace each instance of A2 in the formula by MOD(A2,1).
--
David Biddulph

"dazoloko via OfficeKB.com" <u43760@uwe wrote in message
news:8b9ba69d3ea41@uwe...
Dear All

I have a worksheet which has a start time and an end time for visits
throughout the week, Some lines however are blank

I want a formula which tells me if the end of the visit is before 9.30 am
to
return "morning", if its before 17:00 then return "Afternoon", if its
before
23:30 return "Evening" and if its blank return "Ignore"

Could anyone help me please ?

D

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200810/1



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22
Default Formula

Thank you both for the repsonses, between the two I got it nailed.

Thanks for your time.

D


David Biddulph wrote:
=IF(A2<TIME(9,30,),"morning",IF(A2<TIME(17,,),"Af ternoon",IF(A2<TIME(23,30,),"Evening",IF(A2="","Ig nore","After
evening"))))
I am assuming that your cells contain just a time, not a date and time. If
the latter, replace each instance of A2 in the formula by MOD(A2,1).
--
David Biddulph

Dear All

[quoted text clipped - 10 lines]

D


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200810/1

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



All times are GMT +1. The time now is 06:28 AM.

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"