# YEARFRAC

## 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.