Rational
Return a proportion of years for a given range of dates.
Description
The Excel YEARFRAC function calculates the fraction of years that has elapsed within a given range of dates. Like, to find a number of years in proportion between two dates like 01-01-2017 and 30-09-2017, use =YEARFRAC(startdate,enddate,2), that returns ‘0.755’.
The function is helpful in finding Interest Expense of the given period, the age of the person.
Syntax
=YEARFRAC (start_date, end_date, [basis])
Parameters
start_date – The start date
end_date – The end date
basis [optional] – The type of day count basis (see below).
Return Value
A decimal number representing the proportion of year.
Key Notes
- The YEARFRAC calculate the fragment of a year depicted by the number of days between two given dates.
- Use YEAR function to find the Year component of a given date.
- The cell format of result should have decimal places for precise display of result.
- The formula calculates the difference between two dates and divides the number of days in the year (Default is US (NASD) 30/360). Example: Difference between 01-01-2017 and 30-09-2017 = 272, proportion is 272/360 = 0.755 (2nd basis).
The type of day count of [basis] and their meanings are:
Basis | Day count basis |
0 or omitted | US (NASD) 30/360 |
1 | Actual/actual |
2 | Actual/360 |
3 | Actual/365 |
4 | European 30/360 |
From YEARFRAC Function you can calculate years between two dates like we have dates 10-06-2007 and 10-06-2018 it return 11.
Keep Reading Similar Functions:

DATEDIF
The DATEDIF is an unknown compatibility function that can be used to calculate the difference between two dates. To find years diff.,=DATEDIF(start_date, end_date,”y”).

DATE
The DATE function returns a date value using year, month and date, sequentially. I.e.; to merge all 3 date component, =DATE(2012,12,4) returns “04-12-2012”.

YEAR
The YEAR function extracts the Year component of a given date. Example; to get or find Year from a date (11/08/2017- cell B5), use =YEAR(B5), returns ‘2017’.