+ Reply to Thread
Results 1 to 4 of 4

Future Date - TODAY() : not giving expected result

  1. #1
    Registered User
    Join Date
    09-29-2010
    Location
    Dunstable, England
    MS-Off Ver
    Excel 2010
    Posts
    16

    Future Date - TODAY() : not giving expected result

    Hi,

    I have 2 dates - one future and TODAY()

    I have FUTURE Date - TODAY() which gives me the number of days remaining between the 2 dates.

    However, when I try to format that as 'yymmdd' it seems to add an additional month....

    I've attached a sample....I think....

    Any help would be gratefully received....

    Thanks,
    Simon
    Attached Files Attached Files

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Future Date - TODAY() : not giving expected result

    hi Simon, you cannot format it like this because Excel recognises dates as integers & time as decimals. to verify, type in 1jan2013 in A1. and 12 pm in B1. Format both cells to General. you will see that A1 is 41275 (meaning 41,275th day from 1 Jan 1900) & B1 is 0.5 (1/2 a day).*

    so when you have 31, and it shows you 01 months, it actually means January. you would have to use this instead of the C2-TODAY portion:
    =TEXT(DATEDIF(TODAY(),C2,"y"),"00")&" years "&TEXT(DATEDIF(TODAY(),C2,"ym"),"00")&" months "&TEXT(DATEDIF(TODAY(),C2,"md"),"00")&" days"

    just to be clear. if today is 8 Oct & C2 is:
    8 Oct - it should be 0 years 1 months 0 days cause it's 1 month from today
    7 Oct - it should be 0 years 0 months 30 days cause it's 30 days from today
    9 Oct - it should be 0 years 1 months 1 days cause it's 1 month & a day from today

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  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,723

    Re: Future Date - TODAY() : not giving expected result

    Try this instead:

    =IF($A2="","",IF(TODAY()>=$C2,"Overdue",IF(DATEDIF(TODAY(),C2,"y")=0,"",DATEDIF(TODAY(),C2,"y")&" years ")&IF(DATEDIF(TODAY(),C2,"ym")=0,"",DATEDIF(TODAY(),C2,"ym")&" months ")&DATEDIF(TODAY(),C2,"md")&" days"))

    Format the cell as General.

    Hope this helps.

    Pete

  4. #4
    Registered User
    Join Date
    09-29-2010
    Location
    Dunstable, England
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Future Date - TODAY() : not giving expected result

    Cheers Pete - just what I was looking for......

    @benishiyro - many thanks for the explanation....so glad MS has made date & time so easy in Excel - NOT!!!!

+ 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. Replies: 14
    Last Post: 05-28-2013, 02:06 PM
  2. Replies: 6
    Last Post: 08-23-2012, 12:14 PM
  3. OR Operator Line Not Giving Expected Result
    By Gos-C in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-22-2010, 06:14 AM
  4. create a macro to alert me if today's date is within 5 days of expected delivery date
    By ashmcclure in forum Excel Programming / VBA / Macros
    Replies: 25
    Last Post: 09-25-2008, 05:51 PM
  5. Finding the closest future date from Today from a list of dates
    By maharg in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-18-2008, 09:45 AM

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