YEARFRAC

Returns the number of years, including fractional years, between two dates using a specified day count convention.

Parameter List

Syntax
YEARFRAC(start_dateend_date
[type]
)
start_date

The start date to consider in the calculation. For example: 2021-09-20.

end_date

The end date to consider in the calculation. For example: 2022-03-25.

[optional] type

An indicator of what day count method to use. For example: 0, 1, 2, 3 or 4.

  • If 'type' is '0' or is omitted, indicates US (NASD) 30/360. This assumes 30 day months and 360 day years as per the National Association of Securities Dealers standard, and performs specific adjustments to entered dates which fall at the end of months.
  • A'type' '1' indicates Actual/Actual. This calculates based upon the actual number of days between the specified dates, and the actual number of days in the intervening years. Used for US Treasury Bonds and Bills, but also the most relevant for non-financial use.
  • A 'type' '2' indicates Actual/360. This calculates based on the actual number of days between the specified dates, but assumes a 360 day year.
  • A 'type' '3' indicates Actual/365. This calculates based on the actual number of days between the specified dates, but assumes a 365 day year.
  • A 'type' '4' indicates European 30/360. Similar to 0, this calculates based on a 30 day month and 360 day year, but adjusts end-of-month dates according to European financial conventions.

Examples

YEARFRAC("2021-09-21", "2022-04-06") returns 0.5416666667