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.
The fraction of a year between two dates on the default 30/360 basis:
=YEARFRAC(DATE(2026, 1, 15), DATE(2026, 9, 3))Result
0.6333The same on an actual/actual basis (1) — 231 real days over 365:
=YEARFRAC(DATE(2026, 1, 15), DATE(2026, 9, 3), 1)Result
0.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.
Related functions
More ways Excel gets this done.
- DATEReturns the serial number of a particular dateDateGoogle Sheets
- DATEDIFCalculates the number of days, months, or years between two dates. This function is useful in formulas where you need to calculate an age.DateGoogle Sheets
- DATEVALUEConverts a date in the form of text to a serial numberDateGoogle Sheets
- DAYConverts a serial number to a day of the monthDateGoogle Sheets
- DAYSReturns the number of days between two datesDateGoogle Sheets
- DAYS360Calculates the number of days between two dates based on a 360-day yearDateGoogle Sheets