There are a number of reasons why the result of calculating the difference in years between two dates in Excel is often a decimal number.
The first reason is that different months have a different number of days, so when you calculate the difference in days between two dates, that number will include the differing number of days in each month.
Another reason is that leap years have an extra day, so if one of the dates falls on a leap year and the other doesn’t, that will also impact the result.