+ Reply to Thread
Results 1 to 9 of 9

Calculate Year Month and Days and Add them

  1. #1
    Registered User
    Join Date
    08-13-2009
    Location
    London,England
    MS-Off Ver
    Excel 2016
    Posts
    30

    Thumbs up Calculate Year Month and Days and Add them

    Friends!
    I like to calculate the number of years months and dates from xxx date to yyyy days
    For example:

    25/6/1976 to 15/9/1986 - Calcualte the number of years,months and days


    Please check the attached sample work book for my requirements


    Thanks a lot in advance!

    I solved this with your help friends..

    Please check my second post in this page and give me a solution
    Last edited by lavan_joy; 11-17-2010 at 12:39 PM. Reason: Title updated

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Calculate Year Month and Days

    Have a look at this: http://www.cpearson.com/excel/datedif.aspx

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Calculate Year Month and Days

    Use the Datedif function
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    08-13-2009
    Location
    London,England
    MS-Off Ver
    Excel 2016
    Posts
    30

    Re: Calculate Year Month and Days

    I solved the above calculation using domski's help. Thanks a lot
    Finally I need one more calculation.

    Using that calculation I got the following result. I want to add them.
    Example:
    1) 1 years 1 months 4 days
    2)9 years 10 months 26 days
    3)6 years 10 months 5 days

    The result should be = 17 years 9 months 5 days

    Please check the attachment
    Attached Files Attached Files

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Calculate Year Month and Days

    That's covered on Chip Pearson's page

  6. #6
    Registered User
    Join Date
    08-13-2009
    Location
    London,England
    MS-Off Ver
    Excel 2016
    Posts
    30

    Re: Calculate Year Month and Days

    I oculdn't find anything releated to the totaling the result in that page. If you find anything please post here. thanks

    I got 3 results
    1) 1 years 1 months 4 days
    2)9 years 10 months 26 days
    3)6 years 10 months 5 days

    I want to sum the three results
    Last edited by lavan_joy; 11-17-2010 at 08:49 AM.

  7. #7
    Registered User
    Join Date
    08-13-2009
    Location
    London,England
    MS-Off Ver
    Excel 2016
    Posts
    30

    Re: Calculate Year Month and Days and Add them

    Any help will be appreciated friends!

  8. #8
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Calculate Year Month and Days and Add them

    I think your sums are out slightly, I get 17 years, 10 months and 4 days.

    Anyway this should do the trick without having to do the individual datedif calculations:

    =DATEDIF(DATE(1900,1,1),SUM(C3:C18-B3:B18),"y")&" years "&DATEDIF(DATE(1900,1,1),SUM(C3:C18-B3:B18),"ym")&" months "&DATEDIF(DATE(1900,1,1),SUM(C3:C18-B3:B18),"md")
    &" days"

    Confirmed with Ctrl+Shift+Enter as it's an array formula.

    Dom

  9. #9
    Registered User
    Join Date
    08-13-2009
    Location
    London,England
    MS-Off Ver
    Excel 2016
    Posts
    30

    Re: Calculate Year Month and Days and Add them

    You are right Mr. Dom.17 years, 10 months and 4 days. Thanks a lot for the array solution also.

    Solved.

    Thanks again.
    Last edited by lavan_joy; 11-17-2010 at 12:38 PM.

+ 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