+ Reply to Thread
Results 1 to 4 of 4

If Statement > Time

  1. #1
    Registered User
    Join Date
    11-19-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    2

    If Statement > Time

    Hello,

    I am attempting to give a value for times greater than 19:00 on my list (0 or 1). I have changed the format of the actual start times to everything I know to do (hh:mm, text, text to columns shows am/pm etc) and I cannot seem to get =if(A2>"19:00",1,0) to work. I tried 07:00 pm... The default for A2 is 2/27/2013 10:00:00 AM etc.

    Actual Start After 19:00
    10:00
    16:29
    10:00
    10:00
    19:51
    19:51
    19:51
    16:29
    16:29

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: If Statement > Time

    Your posted formula is reading "19:00" as a text string, not a time value.
    Try
    =if(A2>"19:00"+0,1,0)
    The +0 converts the Text value to a real Time value.

    However, since you usaid A2 is 2/27/2013 10:00:00 etc..
    That means A2 is not only a time value, it's a date and a time together.

    So you have to strip only the time from that cell.
    This will do that
    =MOD(A2,1)

    Put it together, it would be

    =if(MOD(A2,1)>"19:00"+0,1,0)
    Last edited by Jonmo1; 11-19-2013 at 03:54 PM.

  3. #3
    Registered User
    Join Date
    11-19-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: If Statement > Time

    That works great thank you.

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: If Statement > Time

    You're welcome.

+ 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. If statement to determine if time value is higher than another time value
    By xtort81 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-15-2013, 03:48 PM
  2. If Statement Using a Time
    By JoshF in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-28-2011, 11:09 AM
  3. If Statement for time
    By wtangow in forum Excel General
    Replies: 3
    Last Post: 11-15-2011, 11:38 AM
  4. If Statement for Time (hh:mm)
    By lukela85 in forum Excel General
    Replies: 2
    Last Post: 09-24-2010, 01:58 PM
  5. Big Time IF Statement
    By needtolearn in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-26-2008, 04:22 PM

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