Formula

  • Thread starter dazoloko via OfficeKB.com
  • Start date
D

dazoloko via OfficeKB.com

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
 
S

Sandy Mann

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

(e-mail address removed)
Replace @mailinator.com with @tiscali.co.uk
 
D

David Biddulph

=IF(A2<TIME(9,30,),"morning",IF(A2<TIME(17,,),"Afternoon",IF(A2<TIME(23,30,),"Evening",IF(A2="","Ignore","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).
 
D

dazoloko via OfficeKB.com

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

Thanks for your time.

D


David said:
=IF(A2<TIME(9,30,),"morning",IF(A2<TIME(17,,),"Afternoon",IF(A2<TIME(23,30,),"Evening",IF(A2="","Ignore","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
[quoted text clipped - 10 lines]
 

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