Author: Oscar Cronquist Article last updated on August 29, 2018

The YEARFRAC function returns the fraction of the year based on the number of whole days between a start date and an end date.

Use the YEARFRAC function to calculate a part of a whole based on a date range relative to a year.

Formula in cell B8:

=YEARFRAC(C3,C4,C5)

Excel Function Syntax

YEARFRAC(start_date, end_date, [basis])

Arguments

start_date Required.
end_date Required.
[basis] Optional. Day count basis.

0 - Default value. US (NASD) 30/360

1 - Actual/actual

2 - Actual/360

3 - Actual/365

4 - Europaen 30/360

Comments

Use the DATE function to create a date if you enter the date in the function.

Example:

=YEARFRAC(DATE(2018,1,1),DATE(2018,5,31))