The Excel YEARFRAC function calculates the fraction of Year based on a number of whole days between the two entered dates(the start_date and the end_date), in a decimal format. In simple terms, it calculates the duration in years between two dates and returns a proportion when compared to the year(s).
Purpose of Excel YEARFRAC Function
To ascertain the proportion of the year based on two dates.
Return value
YEARFRAC returns a decimal value based on a proportion of the given dates compared to a year.
Syntax
=YEARFRAC(start_date, end_date, [basis])
Arguments
Arguments | Description | Remarks |
start_date | A start date. | Mandatory |
end_date | A end date. | Mandatory |
[basis] | The type of day count. | Optional |
Usage notes
- Only the date portion (not time) of start_date and end_date is used in the calculation.
- Only the integer portion of the basis is used in the calculation. If a decimal value is provided, it will be Only the integer portion of basis is used in the calculation. If a decimal value is provided, it will be.
Availability
Since 2007 for Windows.
Since 2011 for Mac.