In Excel, using the Datedif formula to compare two dates to generate an outcome with a format of x Years, y Months and z Days.
The formula generally looks like:- =DATEDIF(B1,B2,"y")&" years, " & DATEDIF(B1,B2,"ym")&" months, " & DATEDIF(B1,B2,"md")&" days"
However, occasionally this can generate a negative number of days!! Start date End date Generated Output 31/10/1985 01/03/2020 34 years, 4 months, -1 days
Microsoft are aware - https://support.microsoft.com/en-us/office/datedif-function-25dba1a4-2812-480b-84dd-8b32a451b35c - they have a work around, which doesn't work too well either, particularly if the Start date is in a leap year.
Is anyone aware of any other variation or different excel function that does give 100% accurate results?
yearsnormonthshave a fixed number of days, any solution with 100% accurate results is going to depend on your definition/conventions for dealing with this irregularity. Only after you develop your conventions will you be able to devise a solution to test if it is in accord with your conventions. - Ron Rosenfeld