Syntax
| Parameter | Description |
|---|---|
| start_date | Parameter of the YEARFRAC function. |
| end_date | Parameter of the YEARFRAC function. |
| [basis] | (Optional.) Parameter of the YEARFRAC function. |
Examples
Fraction of year
=YEARFRAC("2026-01-01", "2026-07-01")
Prorate annual salary
=75000 * YEARFRAC("2026-03-15", "2026-12-31")
Actual/actual basis
=YEARFRAC("2026-01-01", "2026-07-01", 1)
Common Errors
Occurs when dates are invalid or the basis argument is not 0-4.
Occurs when the basis argument is outside the range 0-4 or dates are out of valid range.
Tips
0=US 30/360 (default), 1=Actual/actual, 2=Actual/360, 3=Actual/365, 4=European 30/360. Finance professionals know which their instrument requires.
Multiply any annual figure by YEARFRAC to get the partial-year amount: annual_rent * YEARFRAC(move_in, move_out) = prorated rent.
=YEARFRAC(birth_date, TODAY()) returns age as a decimal. More precise than DATEDIF for partial-year age calculations.
Try YEARFRAC in Viztab
Import your data and use YEARFRAC with 370+ other formulas. No signup required.
Open Viztab