Apple Numbers YEARFRAC Function: Day-Count Bases and Year Fractions
Compare all five day-count bases with ordinary-date and leap-year fixtures, then reproduce Apple’s example and a simple accrual model.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
YEARFRAC expresses a date interval as a fraction of a year under a selected day-count convention. The convention is part of the calculation: the same two dates can produce different fractions without either result being an arithmetic mistake.
It uses whole dates rather than hours elapsed. Apple states that the time portions of the start and end date/time values are ignored.
Availability and verification
The official YEARFRAC reference was retrieved October 15, 2026. The original function-introduction release and last functioning version are unknown from the checked sources. Current shared function documentation is not a last-working-build test or evidence of identical behavior on every older Mac, iPad, iPhone and iCloud client.
No native Numbers session was executed. The examples use independent arithmetic or constrained text models, with data-dependent results identified explicitly. Public-source retrieval is separate from native verification.
Syntax and the five bases
YEARFRAC(start-date, end-date, days-basis)
The first two arguments are date/time values or date strings. Optional days-basis selects the convention:
- 0 or omitted: US/NASD 30/360
- 1: actual days and actual year length
- 2: actual days divided by a 360-day year
- 3: actual days divided by a 365-day year
- 4: European 30/360
Use explicit DATE formulas or unambiguous date cells in a reproducible worksheet. Do not assume the slash-date string 4/1/2026 means the same day in every regional setting.
Complete ordinary-date worksheet
Put =DATE(2026,4,1) in B2 and =DATE(2026,7,1) in B3. Enter bases 0–4 in A6:A10. In B6 enter =YEARFRAC($B$2,$B$3,A6) and fill down.
| Basis | Independent day-count control | Expected fraction |
|---|---|---|
| 0 | 90 / 360 | 0.25 |
| 1 | 91 / 365 | 0.2493150685 |
| 2 | 91 / 360 | 0.2527777778 |
| 3 | 91 / 365 | 0.2493150685 |
| 4 | 90 / 360 | 0.25 |
These first-of-month dates avoid the month-end differences between the two 30/360 methods. Their agreement here does not make those methods interchangeable for all dates.
Example: a leap-year interval
Use February 1 through March 1, 2024. The actual interval is 29 days. Basis 1 has independent target 29/366 = 0.0792349727; basis 2 gives 29/360 = 0.0805555556; basis 3 gives 29/365 = 0.0794520548.
This fixture is wholly inside one leap year. It does not establish the detailed actual/actual algorithm for a multi-year interval that crosses years of different lengths. The two 30/360 controls for these ordinary first-of-month dates use 30/360, approximately 0.0833333333.
Reproduce Apple’s five-basis example
Apple supplies December 15, 2009 through June 30, 2010. The actual-day control is 197 days, while the ordinary 30/360 control is 195 days.
For bases 0 through 4, the independently reproduced results are 0.5416666667, 0.5397260274, 0.5472222222, 0.5397260274 and 0.5416666667. These match the published examples after rounding to ten decimal places.
Showing both the day numerator and year denominator makes a basis mismatch easier to diagnose than comparing only two rounded percentages.
Advanced: use the fraction in a fictional accrual model
Suppose a model specifies principal 10000, a simple annual rate of 6%, and the April-to-July 2026 interval above. Multiplying principal × rate × fraction gives 149.5890410959 under basis 3 and 151.6666666667 under basis 2. Basis 0 gives 150.
These are independent arithmetic examples, not a statement about the terms of a real loan, tax rule or accounting policy. Select the basis from the applicable model requirements before comparing the results.
Advanced: dates are not elapsed hours
If two input date/time values have the same calendar dates as B2 and B3 but different times of day, the documented time-ignoring rule means those clock times do not add a fractional day to this function’s date calculation. Use a duration calculation instead when the business question is specifically about elapsed hours.
Likewise, a year fraction is not an integer count of completed years. A fraction near 0.25 describes this convention’s annual portion; it is not a statement that a complete year has elapsed.
Errors and troubleshooting
The dedicated entry does not specify every invalid-basis error, text-date coercion or reversed-date result. This guide uses chronological dates and valid integer bases rather than borrowing another spreadsheet’s signed-interval behavior.
Check actual stored dates, the basis value and the units of the consuming formula. More displayed decimals cannot fix an incorrect basis. For February-end and 31st-day cases, consult the specific NASD or European convention before extrapolating the deliberately ordinary 30/360 controls here.