=YEARFRAC(start_date, end_date, [basis])One free generation or explanation per browser, shared across Excel and Google Sheets. Account usage limits apply afterward.
Need more than a single YEARFRAC formula? Try our free AI for Excel — it reads your entire spreadsheet, answers questions in plain English, and builds charts and analysis in the same chat.
start_date:
The starting date from which to calculate the year fraction. This can be a date value, a cell reference containing a date, or a formula that returns a date.
end_date:
The ending date up to which to calculate the year fraction. This can also be a date value, a cell reference containing a date, or a formula that returns a date.
basis:
An optional parameter that specifies the day count basis to use for the calculation. It can be a number from 0 to 4, where each number corresponds to a different day count convention. If omitted, the default value is 0.
The YEARFRAC function in Excel is a useful tool that calculates the year fraction between two dates. It helps you determine the proportion of the year that has passed between a start date and an end date, which can be particularly useful in financial calculations, such as interest calculations or determining the age of an asset.
In simpler terms, the YEARFRAC function allows you to express the difference between two dates as a decimal representing the fraction of the year, making it easier to perform time-based calculations.
Imagine you are managing a financial report for a company, and you need to calculate the fraction of the year that has passed since an asset was purchased. You have the following data in an Excel spreadsheet:
| Asset Name | Purchase Date | Current Date |
|---|---|---|
| Laptop | 2023-01-15 | 2023-10-01 |
| Printer | 2023-03-10 | 2023-10-01 |
| Projector | 2023-05-20 | 2023-10-01 |
You want to find out how much of the year has passed since each asset was purchased.
To calculate the year fraction for the Laptop asset, you would use the YEARFRAC formula as follows:
=YEARFRAC(B2, C2)When you apply the formula for the Laptop, it calculates the fraction of the year that has passed since January 15, 2023, to October 1, 2023. The output would be:
| Year Fraction for Laptop |
|---|
| 0.66 |
Here, the result indicates that approximately 66% of the year has passed since the Laptop was purchased.
The YEARFRAC function is particularly useful when you need to perform calculations that depend on the passage of time, such as calculating interest, depreciation, or the age of an asset. It allows you to easily quantify the time elapsed in a way that is compatible with financial and accounting practices.
Understanding how to use the YEARFRAC function can significantly enhance your financial analysis capabilities in Excel, enabling you to make informed decisions based on the time elapsed between important dates.
Happy calculating!
You have a table where Column A contains the start dates of various projects and Column B contains the end dates of those projects. You can use the YEARFRAC function to calculate the fractional years that each project has been active. This allows for efficient tracking of project durations and helps in assessing project timelines and resource allocation without the complexity of more advanced date calculations.
Beyond the YEARFRAC function: Better Analyst is a full Excel AI that goes well past individual formulas. Upload any spreadsheet and ask questions in plain English — you'll get formulas, data analysis, and charts back in seconds. It's a free AI Excel assistant that works with any .xlsx, .xls, or .csv file — no plugins, no Microsoft 365 required.
Don't have a spreadsheet yet? Use our free AI spreadsheet generator to turn a text prompt into a downloadable Excel file — a full AI Excel sheet maker that builds headers, columns, and formulas from your description.
Create a free account for formula help, explanations, and spreadsheet analysis. Usage limits depend on your plan.
Browse our complete library of Excel formula guides
Compare your options
Open a neutral research prompt in the AI tool you already use. Compare capabilities, limitations, and fit before you choose.
AI answers can be incomplete. Check source links, current pricing, and product documentation before deciding.