Calculation Number Of Days

Instant date span, business days & live distribution

Excel YEARFRAC Formula Calculator

Generate a year-fraction formula by day-count basis.

Result
—

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.

  1. Enter the start date

    Enter the first date.

  2. Enter the end date

    Enter the second date.

  3. Pick the basis

    Choose 0 to 4, from US 30/360 to European 30/360.

  4. 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.

BasisConventionDay count ÷ yearResult
0US 30/360196 ÷ 3600.544444
1Actual/Actual197 ÷ 3650.539726
2Actual/360197 ÷ 3600.547222
3Actual/365197 ÷ 3650.539726
4European 30/360195 ÷ 3600.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.