YEARFRAC function

Category: Date and time
Introduced: Excel 2003

Summary

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

Syntax

YEARFRAC(start_date, end_date, [basis]) The YEARFRAC function syntax has the following arguments:
• Start_date Required. A date that represents the start date.
• End_date Required. A date that represents the end date.
• Basis Optional. The type of day count basis to use.
0 or omitted | US (NASD) 30/360
1 | Actual/actual
2 | Actual/360
3 | Actual/365
4 | European 30/360
Important:
Dates should be entered by using the DATE function, or as results of other formulas or functions. For example, use DATE(2018,5,23) for the 23rd day of May, 2018. Problems can occur if dates are entered as text.
The YEARFRAC function may return an incorrect result when using the US (NASD) 30/360 basis, and the start_date is the last day in February.

Example

=YEARFRAC(A2,A3)
=YEARFRAC(A2,A3,1)
=YEARFRAC(A2,A3,3)

Microsoft Support Page

https://support.microsoft.com/en-us/office/yearfrac-function-3844141e-c76d-4143-82b6-208454ddc6a8

Back to Functions