Skip to content
Excel

YEARFRAC function in Excel

Returns the year fraction representing the number of whole days between start_date and end_date

=YEARFRAC(start_date, end_date, [basis])

YEARFRAC syntax and parameters

Three arguments, two required.

  • start_datenumberRequired

    A date that represents the start date.

  • end_datenumberRequired

    A date that represents the end date.

  • basisnumberOptional

    The type of day count basis to use.

YEARFRAC examples

Formulas you'll actually reuse.

  1. The fraction of a year between two dates on the default 30/360 basis:

    =YEARFRAC(DATE(2026, 1, 15), DATE(2026, 9, 3))

    Result0.6333

  2. The same on an actual/actual basis (1) — 231 real days over 365:

    =YEARFRAC(DATE(2026, 1, 15), DATE(2026, 9, 3), 1)

    Result0.6329

YEARFRAC in Google Sheets

Same name — your formula ports as-is.

Try YEARFRAC in the playground

Edit the example — nothing to install.

Preloaded with the YEARFRAC formula from Example 1 — change anything and watch it respond.

Loading the editor…

YEARFRAC errors

What they mean — and the fixes.

  • #NUM!

    The basis isn't 0–4.