+ Reply to Thread
Results 1 to 7 of 7

convert month days and years into days

  1. #1
    Registered User
    Join Date
    06-23-2009
    Location
    saudi
    MS-Off Ver
    Excel 2003
    Posts
    20

    convert month days and years into days

    I want to convert the number of days calculated into the number of months, days and years

    For example:

    Cell A1 = February 18 2007
    Cell A2 = November 20 2011

    If I am going to subtract A2 to A1, the result in A3 must be in days.

    Thanks
    Last edited by bokals; 11-20-2011 at 01:41 PM.

  2. #2
    Registered User
    Join Date
    11-03-2011
    Location
    Shelton, CT
    MS-Off Ver
    Excel 2010
    Posts
    67

    Re: convert month days and years into days

    How are the cells that contain the date formatted? is it text with the date typed as shown?
    If so, then you need to convert the text to dates as follows:
    Under Data, select "Text to Columns"
    Select Delimited then next
    Select Tab then next
    Select Date, MDY then Finish

    Then you can simply subtract the two dates
    Last edited by optomyst; 11-20-2011 at 01:38 PM. Reason: Updated with alternate answer

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,702

    Re: convert month days and years into days

    For the result in years, months and days try this formula

    =DATEDIF(A1,B1,"y")&" years "&DATEDIF(A1,B1,"ym")&" months "&DATEDIF(A1,B1,"md")
    &" days"

    as suggested here
    Audere est facere

  4. #4
    Registered User
    Join Date
    06-23-2009
    Location
    saudi
    MS-Off Ver
    Excel 2003
    Posts
    20

    Re: convert month days and years into days

    Quote Originally Posted by optomyst View Post
    How are the cells that contain the date formatted? is it text with the date typed as shown?
    If so, then you need to convert the text to dates as follows:
    Under Data, select "Text to Columns"
    Select Delimited then next
    Select Tab then next
    Select Date, MDY then Finish

    Then you can simply subtract the two dates
    Sir,

    I followed your instructions and it convert the text into date format as expected, but when I subtract cell a2 to a1 it gives me the date, month and year. I want the result to be in number of days only.

    thanks

  5. #5
    Registered User
    Join Date
    06-23-2009
    Location
    saudi
    MS-Off Ver
    Excel 2003
    Posts
    20

    Re: convert month days and years into days

    Quote Originally Posted by daddylonglegs View Post
    For the result in years, months and days try this formula

    =DATEDIF(A1,B1,"y")&" years "&DATEDIF(A1,B1,"ym")&" months "&DATEDIF(A1,B1,"md")
    &" days"

    as suggested here
    Sir,

    This is exactly what I need but pardon me for not getting on how to use it. Could you pls give me an sample on excel sheet, I will just modify it.

    thanks

  6. #6
    Registered User
    Join Date
    11-03-2011
    Location
    Shelton, CT
    MS-Off Ver
    Excel 2010
    Posts
    67

    Re: convert month days and years into days

    just change the format of results column to number from date

  7. #7
    Registered User
    Join Date
    06-23-2009
    Location
    saudi
    MS-Off Ver
    Excel 2003
    Posts
    20

    Re: convert month days and years into days

    Quote Originally Posted by optomyst View Post
    just change the format of results column to number from date
    Sir,

    thanks, it does the trick.

    God bless

+ 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