Excel YEARFRAC Formula Calculator
Generate a year-fraction formula by day-count basis.
How the Excel YEARFRAC Formula Calculator Works
The Excel YEARFRAC Formula Calculator writes a =YEARFRAC(start_date, end_date, [basis]) formula that returns the fraction of a year between 2 dates under 5 day-count bases.
Enter the start date
Enter the first date.
Enter the end date
Enter the second date.
Pick the basis
Choose 0 to 4, from US 30/360 to European 30/360.
Copy the formula
Paste the formula and multiply by an annual rate for interest.
How the Count Is Calculated
YEARFRAC divides a day count by a year basis.
=YEARFRAC(start_date, end_date, [basis])
Interest = Principal × Rate × YEARFRAC(...)- basis 0 (default)
- US (NASD) 30/360.
- basis 1
- Actual/Actual.
- basis 2, 3
- Actual/360 and Actual/365.
- basis 4
- European 30/360.
Example: =YEARFRAC("2026-01-15", "2026-07-31", 2) returns 0.547222 (197 ÷ 360). Basis 0 returns 0.544444.
Worked Examples
The table lists YEARFRAC results for 15 January to 31 July 2026.
| Basis | Convention | Day count ÷ year | Result |
|---|---|---|---|
| 0 | US 30/360 | 196 ÷ 360 | 0.544444 |
| 1 | Actual/Actual | 197 ÷ 365 | 0.539726 |
| 2 | Actual/360 | 197 ÷ 360 | 0.547222 |
| 3 | Actual/365 | 197 ÷ 365 | 0.539726 |
| 4 | European 30/360 | 195 ÷ 360 | 0.541667 |
What the Tool Measures
The YEARFRAC function is a spreadsheet function that returns the year fraction between 2 dates.
YEARFRAC basis 1 in Excel averages year lengths for periods that span several years, which differs from the ISDA Actual/Actual method. Results across leap years can differ in the 4th or 5th decimal place.
When to Use This Tool
There are 4 main uses of the Excel YEARFRAC Formula Calculator, including accrued interest and age.
Accrued interest
Analysts multiply YEARFRAC by a coupon rate.
Decimal age
HR sheets show age as 34.47 years with basis 1.
Prorated bonuses
Payroll computes a bonus for a partial year.
Depreciation
Accountants compute partial-year depreciation.