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?
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?
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
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.
=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.
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
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.
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
i found it - function yearfrac.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks