The YEARFRAC function is a date and time function which takes "start_date, end_date, basis" as argument and returns the fraction of the year between two particular dates i.e (start date and end date). The function takes two dates and determines the difference between the numbers of days of those two dates,divides that difference value with the total number of days in a year.
=YEARFRAC(start_date, end_date, basis) In the above syntax start_date denotes the first date of the desired date range and end_date denotes the second date of the desired date range . Basis is an optional argument which specifies the method for counting the days. Basis:
Basis 0 or omitted: US (NASD) 30/360 -Here if date1's day-of-month is 30 and date2's day-of-month is 31, date2's day-of month is changed to 30.
Basis 1: Actual/actual -Computes actual days in each month and actual days in each year.
Basis 2: Actual/360 - Computes the actual difference in days, and presumes that there are always 360 days in a year
Basis 3: Actual/365 - Computes the actual difference in days, and presumes that there are always 365days per year
Basis 4: European 30/360- Assumes that each month has 30 days and the total number of days in the year is 360; any day-of-month in either date1 or date2, or both with a value of 31 changed to 30.
Let us see how the yearfrac function calculates the fraction of the year with the help of the below video.