Google-sheets – How to calculate years left in Google Sheets

google sheetsgoogle-sheets-dates

This is the function I used and it work =YEAR(A1)-YEAR(B1), A1 is today B1 is the date in the future or past. The problem is that I want to round up year and months.

This is the exaple: https://imgur.com/a/BnTfunj .

The answer that I am looking for is 2.2(2 years and 2 months).
I think the problem is with the formatting.

Best Answer

This is the formula

=(year(B3)-year(C3))+(round((month(B3)-month(C3))/12,1))

The logic is:
1 - Calculate the difference in years.
2 - Calculate the difference in months, then divide by 12 (round to one decimal).
3 - Add the years and months together.

This works with dates >12 months, as well as dates <12 months, and even dates within the same year.


Sampla calculations


This screenshot shows the result of decimalisation of months.
Decimalisation of months