+ Reply to Thread
Results 1 to 4 of 4

Determining if a reference time is within a certain time range

  1. #1
    Registered User
    Join Date
    08-09-2012
    Location
    London, Ontario
    MS-Off Ver
    Excel 2007
    Posts
    2

    Determining if a reference time is within a certain time range

    Hello,

    I am working on a project with waterfowl migration and want to find if each location is a "daytime" or "nighttime" location. You can see below what my spreadsheet looks like, I want to determine if the "studytimestamp(GST)" time is between the sunrise or sunset times. The formula that I have entered is =IF(G2>J2&G2<K2,"1","0") yet I am still getting a value of 0 when the time is clearly between sunrise and sunset. Any help on this would be greatly appreciated!

    G1 H1 I1 J1 K1 L1
    studytimestamp(GST) TimeZone DST sunrise sunset day(1)night(0)
    15:15:14 0 0 11:47:46 23:14:45 0
    16:33:35 0 0 11:47:56 23:14:59 0
    01:52:41 0 0 06:08:51 18:15:22 0
    03:36:58 0 0 11:58:08 23:29:25 0
    04:48:14 0 0 06:08:51 18:15:22 0
    05:16:26 0 0 11:47:14 23:19:01 0
    06:26:27 0 0 11:46:43 23:18:32 0

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

    Re: Determining if a reference time is within a certain time range

    Try this

    =IF(AND(G2>J2,G2<K2),1,0)
    Audere est facere

  3. #3
    Registered User
    Join Date
    08-09-2012
    Location
    London, Ontario
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Determining if a reference time is within a certain time range

    That is fantastic - thank you!

  4. #4
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Determining if a reference time is within a certain time range

    @ kweaver

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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