YEARFRAC Function Generator
YEARFRAC returns the fraction of a year between two dates. Used in interest accruals, tenure reports, and age calculations where you need decimal years.
Syntax
=YEARFRAC(start_date, end_date, [basis])Try it — generate a YEARFRAC formula
Examples
Age in years (decimal)
=YEARFRAC(A2, TODAY())A2 is date of birth — returns age with fractional year.
Tenure in years
=YEARFRAC(A2, B2, 1)basis 1 = actual/actual calendar.
Interest period
=Principal*Rate*YEARFRAC(StartDate, EndDate, 2)basis 2 = actual/360 (banking convention).
Tips
- ✓basis 0 (default): 30/360 US. 1: actual/actual. 2: actual/360. 3: actual/365. 4: 30/360 European.
- ✓For whole years only, wrap in INT().
- ✓More accurate than (end-start)/365.25 when leap years matter.
Related Formulas
DATEDIF
DATEDIF calculates the difference between two dates in days, months, or years. P...
NETWORKDAYS
NETWORKDAYS calculates the number of working days between two dates, automatical...
PMT (Loan Payment)
PMT calculates the periodic payment for a loan based on constant payments and a ...
Need a different formula?
Describe any formula in plain English and FormulaPad will generate it.
Try FormulaPad Free