Skip to main content

YEARFRAC

The YEARFRAC function calculates the number of years, including fractional years, between the dates as a decimal fraction.

This function can be useful in financial calculations to determine proportional amounts of interest, insurance premiums, and rent payments for a partial annual period.

Syntax​

YEARFRAC(start_date, end_date, [calculation_method])

ArgumentDescriptionPermitted values
start_dateStart date of the calculation periodDate or reference to a cell containing the date
end_dateEnd date of the calculation periodDate or reference to a cell containing the date
[calculation_method]
  • 0 (US, NASD) — all months are rounded to 30 days and all years to 360 days. Used by default.
  • 1 — without rounding
  • 2 — months are not rounded, years are rounded to 360 days
  • 3 — months are not rounded, years are rounded to 365 days
  • 4 (EU) — all months are rounded to 30 days and all years to 360 days
0, 1, 2, 3, 4

Examples of use​

Calculation of the fraction of the year between January 1, 2023, and July 1, 2023, using calculation method 1 (actual days/actual days in the year):

=YEARFRAC("01/01/2023", "07/01/2023", 1)

Result: a value approximately equal to 0.5.

Calculation of the fraction of the year between January 1, 2023, and December 31, 2023, based on 0 (US 30/360 method):

=YEARFRAC("01/01/2023", "12.31.2023")

Result: 1.

Notes​

Make sure that the cells containing dates have the correct date format for proper functioning.