What is the YEARFRAC Function
The YEARFRAC function returns the fraction of a year between two dates. It is useful for calculating partial years, for interest calculations, and for precise age or tenure measurement.
Formula: =YEARFRAC(start_date, end_date, [basis])
Practical Example 1
Start A2, End B2.
Type: =YEARFRAC(A2, B2)
Result: a value like 1.25 (one and a quarter years)
Practical Example 2
Use basis 1 for actual days in the year.
Type: =YEARFRAC(A2, B2, 1)
Result: the actual fraction based on real days
Practical Example 3
Calculate partial year for interest.
Type: =YEARFRAC(A2, B2) * InterestRate
Result: the prorated interest amount
When to Use It
YEARFRAC is used for calculating partial year service, for prorating interest, for precise age measurement, for tenure calculations with fractional years, and for any formula where you need the exact fraction of a year between dates.