To round the decimal value of the year, select the cell where you need to calculate the result, go to the Formula bar, type the formula =INT(YEARFRAC(B1,A1)), and press Enter.
How to round the decimal value of year in Excel