+ Reply to Thread
Results 1 to 8 of 8

Convert Duration to Numbers of Months

  1. #1
    Forum Contributor
    Join Date
    06-03-2010
    Location
    Jeddah, Saudi Arabia
    MS-Off Ver
    Excel 2013
    Posts
    135

    Convert Duration to Numbers of Months

    Hi to all Experts,

    i m wondering a formula which convert my duration i.e. number of days convert into number of months:

    for example :

    605 Days : after conversion of this it should appear like that
    20 Months & sixteen days etc.

    pls help me somebody....

    thanks in advance

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,576

    Re: Formaula for Convert Duration to Numbers of Months

    But it's not same if you look for example:

    100 days:

    1.1.2011 - 10.04.2011 is 3 months and 10 days
    20.1. 2011 - 29.4.2011 is how much? (Please enter some value)
    1.2.2011 - 11.05.2011 is 3 months and 11 days

    What you expect as result in those cases?

  3. #3
    Forum Contributor
    Join Date
    06-03-2010
    Location
    Jeddah, Saudi Arabia
    MS-Off Ver
    Excel 2013
    Posts
    135

    Re: Formaula for Convert Duration to Numbers of Months

    dear zobar,

    u r correct ok but i need formula for that

    bcz i want to count the number of months.

    pls provide me any particular formula for that .


    thanks.....

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,576

    Re: Formaula for Convert Duration to Numbers of Months

    It's not problem but I'm asking you this because we need to know how to calculate it.

    So we need to know what's your expected result.

    here is simplier solution:

    30 days

    that can be:

    0 month 30 days (for example January, number of month days is 31)
    1 month 2 days (for example February, number of month days is 28).
    1 month 0 days (for example March, number of month days is 30)

    So, when you enter 30... What you expect to get as result?

  5. #5
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Formaula for Convert Duration to Numbers of Months

    Assuming you arrive at the number of days by subtracting two dates
    Say in A2
    16/10/2009
    In B2
    13/06/2011
    Then
    =B2-A2 returns 605

    =DATEDIF(A2,B2,"m") ..... returns 19 (months)

    =DATEDIF(A2,DATE(YEAR(B2),MONTH(B2)-DATEDIF(A2,B2,"m"),DAY(B2)),"d") ....returns 28 (days)

    Concatenate these
    Please Login or Register  to view this content.
    This returns:= "19 Months & 28 days."

    Hope this helps
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  6. #6
    Forum Contributor
    Join Date
    06-03-2010
    Location
    Jeddah, Saudi Arabia
    MS-Off Ver
    Excel 2013
    Posts
    135

    Re: Formaula for Convert Duration to Numbers of Months

    Thanks Mr. Marcol for your clarification,

    as u described that :

    Say in A2
    16/10/2009
    In B2
    13/06/2011
    Then
    =B2-A2 returns 605

    upto here all picture are clear but while using formula DATEIF i m little bit confuse.

    Which is that DATEIF is not any formula in excel & according to quoted some code by u tell me that how to apply this code in my work book through that i can execute that DATEIF formula & can get desired result.

    pls need clear reply,,,

    thanks

  7. #7
    Forum Contributor
    Join Date
    06-03-2010
    Location
    Jeddah, Saudi Arabia
    MS-Off Ver
    Excel 2013
    Posts
    135

    Re: Formaula for Convert Duration to Numbers of Months

    thanks.............

    no need to reply,,,,,,


    thanks..................

  8. #8
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Formaula for Convert Duration to Numbers of Months

    See here for a full explanation of this undocumented function
    Chip Pearson - The DATEDIF Worksheet Function

+ 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