Date and time

YEARFRAC

Express a period between two dates as a fraction of a year using a chosen basis.

Syntax

=YEARFRAC(start_date, end_date, [basis])

Worked example

Divide the actual 365 elapsed days by 365 using basis 3.

=YEARFRAC(DATE(2025,1,1),DATE(2026,1,1),3)

Result 1

Microsoft documentation

Check the arguments, supported editions and behavior of this function in Microsoft’s reference.

Microsoft reference

Search ExcelTutor