+ Reply to Thread
Results 1 to 6 of 6

IF Timestamps is Greater than and Less than two timevalues

  1. #1
    Forum Contributor
    Join Date
    08-08-2012
    Location
    USA, CA
    MS-Off Ver
    Excel 2007
    Posts
    131

    Question IF Timestamps is Greater than and Less than two timevalues

    I have a list of timestamps and want to mark yes if the timestamp is >18:00 and <7:30.

    I can't figure it out and keep getting value string as the result.

    =IF(AND(TIMEVALUE>("18:00"),TIMEVALUE<("7:30"))),"yes","no")

    Thank you, Appreciate your help.

    N

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

    Re: IF Timestamps is Greater than and Less than two timevalues

    It can't be both greater than 18:00 AND less than 7:30 at the same time - do you mean OR ?

    Hope this helps.

    Pete

  3. #3
    Forum Contributor
    Join Date
    08-08-2012
    Location
    USA, CA
    MS-Off Ver
    Excel 2007
    Posts
    131

    Re: IF Timestamps is Greater than and Less than two timevalues

    If it is greater than 18:00 through 7:30. So I will be marking Yes if 18:00,01,02...to.....7:20,21,22,23,24..30.

    I guess it can be IF(OR(TIMEVALUE>("18:00"),TIMEVALUE<("7:30")),"Yes","No")???

    I need to mark all other time stamps with No in other words.

    Thank you,
    N

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: IF Timestamps is Greater than and Less than two timevalues

    Quote Originally Posted by newbie4 View Post
    If it is greater than 18:00 through 7:30. So I will be marking Yes if 18:00,01,02...to.....7:20,21,22,23,24..30.

    I guess it can be IF(OR(TIMEVALUE>("18:00"),TIMEVALUE<("7:30")),"Yes","No")???

    I need to mark all other time stamps with No in other words.

    Thank you,
    N
    I assume your time range is 6:00 PM to 7:30 AM.

    In which case you'll have to use an OR comparison since the time "resets" to 0 at midnight.

    Data Range
    A
    B
    C
    D
    E
    1
    Time
    Status
    6:00 PM
    7:30 AM
    2
    8:50 AM
    No
    3
    7:32 AM
    No
    4
    6:17 AM
    Yes
    5
    8:43 PM
    Yes
    6
    3:35 AM
    Yes
    7
    9:34 AM
    No
    8
    12:44 AM
    Yes
    9
    9:38 PM
    Yes
    10
    6:07 AM
    Yes
    11
    5:26 AM
    Yes
    12
    9:09 PM
    Yes
    13
    3:13 AM
    Yes
    14
    3:37 PM
    No
    15
    8:10 PM
    Yes
    16
    ------
    ------
    ------
    ------
    ------


    This formula entered in B2 and copied down:

    =IF(OR(A2>D$1,A2<E$1),"Yes","No")
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Forum Contributor
    Join Date
    08-08-2012
    Location
    USA, CA
    MS-Off Ver
    Excel 2007
    Posts
    131

    Re: IF Timestamps is Greater than and Less than two timevalues

    I didn't notice, but my timestamp has dates as well. Where would I put in the MON(""). I hate when excel leaves in the month even if you format to 13:30.

    Thank you, Appreciate your help and support.

    -N

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: IF Timestamps is Greater than and Less than two timevalues

    In that case try this version:

    =IF(OR(A2-INT(A2)>D$1,A2-INT(A2)<E$1),"Yes","No")

+ 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. Difference between two timestamps
    By tweitzel79 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-20-2014, 02:28 PM
  2. Timestamps excel
    By excelvin in forum Excel General
    Replies: 1
    Last Post: 11-05-2012, 12:34 PM
  3. Multiple Timestamps
    By mmogharreban in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-19-2012, 03:42 PM
  4. Sum of timestamps
    By bobsmith2008 in forum Excel General
    Replies: 3
    Last Post: 05-11-2010, 08:30 AM
  5. Multiple Timestamps
    By Push Latency in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-24-2007, 05:57 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