YEARFRAC function

This function, for given start and end date, calculates how much time has passed in years, and as a result returns a decimal number. It can be used to calculate annual interest, future value and in other cases when it is necessary to know how many years have passed. In the text that follows, through a simple example, you will get to know this function.

The syntax of the YEARFRAC function is as follows:

YEARFRAC (<start date>,<end date>,[<base>])

The first two arguments are the starting and ending dates, and the last one is the basis on which we set the way to calculate the period of one year. The last parameter is optional.

So, if within this function we set 1/1/2022 as the starting date and the date of this post, calculated using the TODAY() function, as the end date we will see that 1.53 years have passed.