Returns the number of years including fraction between two dates.
YEARFRAC(startdate; enddate; basis)
returns the number of years between the startdate and enddate; basis is an integer specifying the system of how many days are in a month or year, as follows:
basis | day counting system | |
|---|---|---|
0 | US (NASD) system. 30 days/month, 360 days/year (30/360) | |
1 | Actual/actual | |
2 | Actual/360 | |
3 | Actual/365 | |
4 | European 30/360 |
YEARFRAC("2007-01-01";"2009-07-01";0)
returns 2.5.
YEARFRAC("2008-01-01";"2008-07-01";3)
returns 0.498630136986.
Here is a real-world example using a hypothetical employee database. Let's say a company needs to find the number of full years each employee has worked to determine who is eligible for a long-service award, which is given after 10 full years of employment.
Employee Data Table:
Employee ID | Name | Start Date | End Date | Years of Service | Eligible for Award? (Years >= 10) | ||
|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | ||
1 | 101 | John Smith | 3/15/2005 | 8/8/2025 | 20 | Yes | |
2 | 102 | Jane Doe | 6/20/2018 | 8/8/2025 | 7 | No | |
3 | 103 | Peter Jones | 11/1/2010 | 8/8/2025 | 15 | Yes | |
4 | 104 | Mary Williams | 1/10/2024 | 8/8/2025 | 1 | No |
The "Eligible for Award?" column is a result of a conditional check, not a direct calculation from the YEARS function itself. It's a binary outcome (Yes/No) based on whether an employee meets the eligibility criteria for the long-service award.
Here's a breakdown of the results in that column, row by row:
PRODUCT & FEATURES
RESOURCES
Terms | Privacy | Spam Policy
© 2026 Zapof