+ Reply to Thread
Results 1 to 6 of 6

Check if cell is in time interval

  1. #1
    Registered User
    Join Date
    08-11-2010
    Location
    Sweden
    MS-Off Ver
    Excel 2007
    Posts
    93

    Check if cell is in time interval

    Hello forum,

    I have 5 columns with time values, let say A1 is the actual time visited and B1,C1 is the first time interval and D1, E1 is the second time interval. I need to check if A1 falls into one of these time intervals. If it does than "TRUE" or else "FALSE". Time intervals can be very different from one to another, an example

    A1 07:12
    B1 07:00
    C1 12:00
    D1 13:00
    E1 16:00

    Then cell F1 will be "TRUE"

    A1 16:05
    B1 07:00
    C1 12:00
    D1 13:00
    E1 16:00

    Then cell F1 will be "FALSE"

    Possible?
    Regards
    Soren
    Last edited by soli004; 12-23-2016 at 09:49 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Check if cell is in time interval

    This maybe (unless you want VBA):

    =IF(OR(AND(A1>=B1,A1<=C1),AND(A1>=D1,A1<=E1)),TRUE,FALSE)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,726

    Re: Check if cell is in time interval

    Try this in F1:

    =OR(AND(A1>=B1;A1<=C1);AND(A1>=D1;A1<=E1))

    Hope this helps.

    Pete

  4. #4
    Registered User
    Join Date
    08-11-2010
    Location
    Sweden
    MS-Off Ver
    Excel 2007
    Posts
    93

    Re: Check if cell is in time interval

    Thanks, that works great, if there is an VBA solution that would be great as well.

    Soren

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Check if cell is in time interval

    If you are holding out for a VBA solution, then don't mark the thread as solved!

  6. #6
    Registered User
    Join Date
    08-11-2010
    Location
    Sweden
    MS-Off Ver
    Excel 2007
    Posts
    93

    Re: Check if cell is in time interval

    Ahh yes, it would be a bonus....

+ 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. lock cell/sheet after time interval
    By cybrkada in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 08-02-2014, 01:52 AM
  2. Replies: 1
    Last Post: 04-29-2014, 04:42 AM
  3. [SOLVED] One cell Time interval format ??
    By Lukael in forum Excel Formulas & Functions
    Replies: 26
    Last Post: 02-12-2014, 04:21 PM
  4. [SOLVED] look up cell value in time interval
    By Vestlink in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-22-2014, 03:00 AM
  5. [SOLVED] Display value from cell with the time interval
    By iqballud in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-15-2013, 05:03 AM
  6. Formula which adds :00 to a time interval taken from another cell
    By KBTIERN in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-30-2012, 04:38 PM
  7. Replies: 0
    Last Post: 04-23-2012, 10:06 AM

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