+ Reply to Thread
Results 1 to 4 of 4

Today() Formula with Time

  1. #1
    Registered User
    Join Date
    04-14-2014
    Location
    Louisville KY
    MS-Off Ver
    Excel 2010
    Posts
    9

    Today() Formula with Time

    Hello -

    So I have a data set that I'm pulling from a SQL table which populates a date with a time; the tiem and date are associated with a deadline.
    I'm trying to write a formula that shows when a "case' is:
    1. Past its deadline
    2. Its deadline is today
    3. Its deadline is tomorrow
    4. Its deadline is the next day... and so on

    The formula I'm using for the above 1. is =IF(Q201<TODAY(),"Yes","No") (Q201 is where the date and time are)
    I then tried to use formula =IF(Q201=TODAY(), "Yes", "No") for 2.
    and formula =IF(Q201=TODAY()+1, "Yes", "No") for 3. and so on.

    The formula for 1. works no problem; the formulas for 2., 3., 4., so on do not show the correct response (i.e. "No" when it should be "Yes")

    I think the issue is that in the Deadline date the time is autopopulated to 11:59 PM but it still doesnt make sense because thats still techinally today.

    For example Q201 is 09/29/14 11:59 PM; so for 1. it states "No" as the case is not past todays date which is correct. For 2. it should be "Yes" as today is 09/29/2014 but is stating "No".

    I'm thinking that when I put in the formula =TODAY() in the date and time format it brings up 09/29/2014 12:00 AM so something with the time is messing my formula up.
    Any help is appreciated. Thanks!

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Today() Formula with Time

    Excel stores date as a count of days since 1/1/1900 and time as a decimal of 1 day.

    Therefore your time is really just a large integer with a bunch of decimals. You don't want the decimals.

    Let =INT(Q201) be your date comparison, such that INT(Q201)=TODAY will evaluate correctly.

    Otherwise, today at 12:00PM will be stored as 41911.5, and that does not =TODAY() which is stored as 41911.00
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Registered User
    Join Date
    04-14-2014
    Location
    Louisville KY
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Today() Formula with Time

    daffodil11 that works perfect! Thank you very much!

  4. #4
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Today() Formula with Time

    No problem, glad I could help!

+ 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. Hello all, signed in first time today
    By lsheppler in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 02-06-2013, 08:09 PM
  2. [SOLVED] Lead time from today
    By Joe.lel in forum Excel General
    Replies: 4
    Last Post: 06-22-2012, 07:42 AM
  3. [SOLVED] Functions like Today() and VLOOKUP for an one time use
    By boerbende in forum Excel General
    Replies: 2
    Last Post: 12-09-2011, 03:47 AM
  4. Replies: 3
    Last Post: 01-12-2010, 05:17 AM
  5. [SOLVED] how do I get a current time using =TODAY() instead of 12:00 AM
    By Keith in forum Excel General
    Replies: 10
    Last Post: 06-26-2006, 03:35 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