+ Reply to Thread
Results 1 to 5 of 5

Calculate remaining # of days between 2 dates

  1. #1
    Registered User
    Join Date
    08-13-2009
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    2

    Calculate remaining # of days between 2 dates

    I know I may use Datedif(startdate, enddate,"d") to get # of days between 2 dates, but I have to calculate the exact number of months and then the remaining number of days seperately.

    For example, startdate=June 15, 2007 and enddate=August 7, 2009, then Datedif(startdate, enddate, "m")=25, but how to get the remaining # of days which is 23?

    Thanks!
    Last edited by Potato2009; 08-13-2009 at 01:43 PM.

  2. #2
    Registered User
    Join Date
    08-04-2009
    Location
    Brussels, Belgium
    MS-Off Ver
    Excel 2003
    Posts
    54

    Re: Calculate remaining # of days between 2 dates

    the same formula but set Interval as "md" - this should give the number of days

    (http://www.cpearson.com/excel/datedif.aspx)

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Calculate remaining # of days between 2 dates

    if you scroll down in that link you'll see this
    =IF(DATEDIF(A1,B1,"y")=0,"",DATEDIF(A1,B1,"y")&" years ")&IF(DATEDIF(A1,B1,"ym")=0,"",DATEDIF(A1,B1,"ym")&" months ")&DATEDIF(A1,B1,"md")&" days"
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  4. #4
    Registered User
    Join Date
    08-13-2009
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Calculate remaining # of days between 2 dates

    Thank you!

  5. #5
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Calculate remaining # of days between 2 dates

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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