YEARFRAC Function
Returns the fraction of a year between two dates.
Category
Date & Time
Available in
All versions, Microsoft 365
Returns
A decimal number of years
Overview
YEARFRAC returns how much of a year lies between two dates — 0.5 for six months. Use it to prorate salaries, bonuses, rent or interest.
The basis argument picks the day-count rule: 30/360 (the default) or the real number of days.
Syntax
Arguments
| Argument | Required? | What it does |
|---|---|---|
| start_date | Yes | The first date. |
| end_date | Yes | The second date. The order doesn't matter — the result is always positive. |
| basis | Optional | 0 or omitted US 30/360, 1 actual/actual, 2 actual/360, 3 actual/365, 4 European 30/360. |
Examples
Example 1 — Same dates, different day counts
January 1 to July 1, 2026 under each basis.
| A | B | |
|---|---|---|
| 1 | Basis | Fraction |
| 2 | 0 (30/360) | 0.5000 |
| 3 | 1 (actual/actual) | 0.4959 |
| 4 | 2 (actual/360) | 0.5028 |
| 5 | 3 (actual/365) | 0.4959 |
181 real days divided by 365 gives 0.4959; the 30/360 rule counts exactly six 30-day months.
Example 2 — Prorated bonus for a mid-year starter
A $12,000 annual bonus for someone who started on 7/1/2026, paid to 12/31/2026.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Start | Year end | Annual bonus | Prorated |
| 2 | 7/1/2026 | 12/31/2026 | 12000 | 6016.44 |
Common mistakes
- Small differences from a manual calculation. Check the basis. Leaving it out uses 30/360, which rarely matches a simple days ÷ 365.
Notes

Author
Kyle Stott
Certified Microsoft Excel Expert
Kyle has worked professionally with Microsoft Excel for over a decade and has consulted on and taught Excel best practices to over 400 companies across 30+ countries.