Written by Allen Wyatt (last updated November 9, 2019)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365
One of the types of data that Excel allows you to store is, of course, dates. At some point you may wish to perform some calculations with the dates in your worksheet. It is not uncommon to need to figure out the percentage of a year represented by the difference between two dates. Excel allows you to calculate this easily using the YEARFRAC worksheet function.
To use the function, all you need to do is provide two dates and a value that specifies how Excel should calculate the fractional year:
=YEARFRAC(DateOne, DateTwo, Basis)
The dates used by YEARFRAC can be either static dates, or they can be references to cells that contain dates. The Basis value ranges between 0 and 4, with 0 being the default. The following are the different meanings for the Basis:
Basis | Meaning | |
---|---|---|
0 | US 30/360 | |
1 | Actual/actual | |
2 | Actual/360 | |
3 | Actual/365 | |
4 | European 30/360 |
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (9366) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365. You can find a version of this tip for the older menu interface of Excel here: Calculating Fractions of Years.
Solve Real Business Problems Master business modeling and analysis techniques with Excel and transform data into bottom-line results. This hands-on, scenario-focused guide shows you how to use the latest Excel tools to integrate data from multiple tables. Check out Microsoft Excel 2013 Data Analysis and Business Modeling today!
Simple math will tell you what the previous day is (just subtract 1 from today's date). What if you want to know the date ...
Discover MoreNeed to print an elapsed date in a strange format? It's easier to do than may appear at first glance. Here's a discussion ...
Discover MoreDifferent businesses have different ways to calculate elapsed time for billing purposes. Figuring out a formula that ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2019-11-09 07:00:31
DONtheMON
Thank you Willy. Information is not always clarification, but that source is a good reference to have.
2019-11-09 06:30:22
Willy Vanhaelen
Expanation about the meaning of the 5 basis arguments can be found at:
https://en.wikipedia.org/wiki/Day_count_convention
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2023 Sharon Parq Associates, Inc.
Comments