Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, and Excel in Office 365. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Calculating Fractions of Years.

# Calculating Fractions of Years

by Allen Wyatt
(last updated May 10, 2019)

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 Office 365. You can find a version of this tip for the older menu interface of Excel here: Calculating Fractions of Years.

##### Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

##### MORE FROM ALLEN

Controlling How Word Sorts Text

Word has a very orderly way in which it sorts information, but that orderly method may not meet what you need to have ...

Discover More

Getting Audible Feedback

Want to get a little bit of sound with your data? Excel can provide audible feedback that you may find helpful. Here's how.

Discover More

Measuring Efficiency of Formulas and Macros

As the limits on what you can store in Excel have increased, so has the need to consider how to make your workbooks and ...

Discover More

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!

##### More ExcelTips (ribbon)

Changing How Excel Determines which Year to Use

When you enter a date into a cell and you omit the year, Excel helpfully adds the current year to the date. If you want ...

Discover More

Tombstone Date Math

Doing math with dates is easy in Excel. Doing math with old dates, such as those you routinely encounter in genealogy, is ...

Discover More

Converting UNIX Date/Time Stamps

If you import information generated on a UNIX system, you may need to figure out how to change the date/time stamps to ...

Discover More
##### Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. Youâ€™ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 6 - 5?

2019-06-05 17:37:19

John E Hains Jr

The "actual/actual" in Basis 1 is "actual days in the month"/365.25 in case anyone was as curious as I was.

2014-08-04 08:02:47

Bryan

If you are going to use the results of the calculation in another formula it would be better to use cell formatting to change the number of decimal places instead of using a formula. This way you are using full precision and you won't get rounding errors down the road.

2014-08-03 08:26:37

Bob Beechey

Ray's suggestion could be simplified with:
=ROUND(YEARFRAC(Date1, Date2, Basis),2)
The most accurate basis for most applications is 1 where the actual dates for each relevant month is divided by the actual number of days for the years concerned.

2014-08-02 09:58:06

Ray

To display 2dp: Format the cell to 2 decimal places.
If you want to round the result to 2dp use =(INT(C3*100+0.5))/100 where the number to be rounded is in C3.
Or you can combine as
=(INT((YEARFRAC(DateOne, DateTwo, Basis)*100+0.5))/100

2014-08-02 08:10:11

Pete

How can I adapt this formula so that the result is to just two decimal places?

##### This Site

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.