Formualizer Docs
ReferenceFunctionsDate & Time Functions

YEARFRAC

YEARFRAC: Returns the fraction of a year between two dates for a selected day-count basis.

Summary

Returns the fraction of a year between two dates for a selected day-count basis.

Remarks

  • Supported basis values: 0 (US 30/360), 1 (actual/actual), 2 (actual/360), 3 (actual/365), 4 (European 30/360).
  • If start_date > end_date, the result is negative.
  • Invalid basis values return #NUM!.
  • Serial dates are interpreted with the Excel 1900 mapping rather than workbook 1900/1904 context.

Examples

Actual/360 convention
Grid
CellValue
No inputs on Sheet1.
Formula
=
Result
Not evaluated yet.
Expected
0.5027777778
Actual/365 convention
Grid
CellValue
No inputs on Sheet1.
Formula
=
Result
Not evaluated yet.
Expected
0.495890411

FAQ

How does the basis argument change YEARFRAC?

Basis selects the day-count convention (actual or 30/360 variants), so the same dates can yield different fractions.

Runtime metadata

Category

Date & Time

Signature

YEARFRAC(arg1: Number, arg2: Number, arg3…: Number)

Arity

min 2, max variadic

Arguments

arg1

Number · Scalar · coercion NumberLenientText

arg2

Number · Scalar · coercion NumberLenientText

arg3

Number · Scalar · coercion NumberLenientText

Caps

PURE

Source

On this page