YEARFRAC Function
Return the fraction of a year between two dates. start_date and end_date are the dates, and basis_or_method selects the day count convention: 0 (US 30/360, the default), 1 (actual/actual), 2 (actual/360), 3 (actual/365) or 4 (European 30/360). Another basis returns #NUM!. When end_date is before start_date, TX Sheet Control returns a negative fraction.
Syntax
YEARFRAC(start_date, end_date, basis_or_method)
Category: Date & Time. Minimum arguments: 2. Maximum arguments: 3.
Available for supported offline calculation.
Examples
=YEARFRAC(DATE(2026,1,1),DATE(2027,1,1),3)
The formula returns 1, the full year from January 1, 2026, to January 1, 2027, on the actual/365 basis.
Cell and range examples require appropriate input values in the referenced cells. Handle invalid arguments, formula errors and array and spill constraints.