+ Reply to Thread
Results 1 to 8 of 8

Difference between two dates in terms of years

  1. #1
    Forum Contributor
    Join Date
    04-24-2012
    Location
    Moscow
    MS-Off Ver
    Excel 2010
    Posts
    291

    Difference between two dates in terms of years

    Hi all, what is the formula to get displayed Difference between two dates in terms of years? Or how to convert namber of days to be in terms of years?

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: Difference between two dates in terms of years

    If you just subtract two dates then you get the number of days, so to convert this into years you need to divide by 365 (or 365.25 to be slightly more accurate) and format the cell as number, like this:

    =(B1-A1)/365.25

    Hope this helps.

    Pete

  3. #3
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Difference between two dates in terms of years

    Hi,

    a possibility

    =DATEDIF(A1,B1,"Y")

    in A1 younger date.

    Regards

    Some good information about the function here:

    http://www.cpearson.com/excel/datedif.aspx
    Last edited by canapone; 04-28-2012 at 05:54 AM.
    -----------------------------------------------------

    At Excelforum, you can say "Thank you!" by clicking the star icon ("Add Reputation") below the post.

    Please, mark your thread [SOLVED] if you received your answer.

  4. #4
    Forum Contributor
    Join Date
    04-24-2012
    Location
    Moscow
    MS-Off Ver
    Excel 2010
    Posts
    291

    Re: Difference between two dates in terms of years

    =YEAR(A3)-YEAR(A2) will be the solution - doesn't work if def is less than 1 year..
    Last edited by Alexander_Golinsky; 04-28-2012 at 06:19 AM.

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: Difference between two dates in terms of years

    So, if A2 is a date in December and A3 is in January the next year, you want an answer of 1 year difference?

    Pete

  6. #6
    Forum Contributor
    Join Date
    04-24-2012
    Location
    Moscow
    MS-Off Ver
    Excel 2010
    Posts
    291

    Re: Difference between two dates in terms of years

    i need fractions - for example 2.36 years.. and your solution is not that good. What if i need difference app of 30 years. I wont check leap not leap - it has to be automatic
    Last edited by Alexander_Golinsky; 04-28-2012 at 06:21 AM.

  7. #7
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: Difference between two dates in terms of years

    Follow my suggestion in Post #2, but format as Number with 2 decimal places. Over 30 years, the approximation of using 365.25 as the divisor becomes more accurate - it is less accurate for smaller numbers of years. As a "year" is a variable length of time, then you need to define what you mean by a year.

    Pete

  8. #8
    Forum Contributor
    Join Date
    04-24-2012
    Location
    Moscow
    MS-Off Ver
    Excel 2010
    Posts
    291

    Re: Difference between two dates in terms of years

    i found it - function yearfrac.

+ 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