+ Reply to Thread
Results 1 to 3 of 3

Determine if time range falls within the day, evening, or an in between period

  1. #1
    Registered User
    Join Date
    01-07-2014
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    2

    Question Determine if time range falls within the day, evening, or an in between period

    Hi. This is my first post so I hope I phrase my question correctly. I have a college course schedule and I need to determine if each course meeting occurs during the day (7 am to 5 pm), the evening (5 pm to 11 pm) or if it straddles the am/pm border (4 PM to 7 PM), in which case a judgment call will need to be made to determine whether it should be considered a day or evening course. I cannot seem to construct a conditional formula that can identify which courses occur in that indeterminate time zone (I'm new to IF formulas). I've gotten as far as a formula that returns a correct value for pure day courses and pure evening courses, but it puts every course that crosses the 5 PM barrier into the evening category.

    =IF($C$2:$C$13<$H$2,"Day",IF($C$2:$C$13>=$H$4,"Evening"))

    Below is a sample of the kind of course times I'm dealing with. I've tried using AND and Or in the formulas but I just can't figure it out. Any help the forum could provide would be very, very appreciated. Thanks! Jean

    Course Start Time Course End Time Course End Time
    1 8:00 AM 6:00 PM Evening Day < 5:00 PM
    2 8:10 AM 4:30 PM Day Check > 4:00 PM < 7:00 PM
    3 2:00 PM 6:00 PM Evening Evening >= 5:00 PM
    4 5:30 PM 9:00 PM Evening
    5 8:00 AM 4:15 PM Evening
    6 3:00 PM 4:30 PM Day
    7 9:00 AM 2:00 PM Day
    8 7:15 AM 9:30 PM Evening
    9 8:00 AM 4:30 PM Day
    10 3:00 PM 4:30 PM Day
    11 9:00 AM 2:00 PM Day
    12 4:30 PM 6:30 PM Evening

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Determine if time range falls within the day, evening, or an in between period

    Try working in reverse

    =IF(C2>"19:00"+0,"Evening",IF(C2>"16:00"+0,"In between","Day"))

    copy formula down column
    Audere est facere

  3. #3
    Registered User
    Join Date
    01-07-2014
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Determine if time range falls within the day, evening, or an in between period

    Quote Originally Posted by daddylonglegs View Post
    Try working in reverse

    =IF(C2>"19:00"+0,"Evening",IF(C2>"16:00"+0,"In between","Day"))

    copy formula down column


    Thank you, daddylonglegs! I'll give it a try!
    Last edited by daddylonglegs; 01-09-2014 at 05:10 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 4
    Last Post: 10-19-2013, 06:43 PM
  2. If time period falls outside of normal working hours how many hours does it add.
    By chrisdromey in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-02-2013, 11:56 PM
  3. [SOLVED] Determine if a value falls within a horizontal and vertial range
    By td87280 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-31-2012, 05:13 PM
  4. Replies: 3
    Last Post: 07-31-2012, 04:44 PM
  5. [SOLVED] Formula to determine whether number falls within range??
    By Cat in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-16-2005, 10:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1