Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 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

Written by Allen Wyatt (last updated July 19, 2023)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365


2

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.

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

Deleting All Tab Stops

Tab stops can be helpful when you want to align text within a paragraph. However, you might also want an easy way to get ...

Discover More

Automatic Selection of Portrait or Landscape

Should you print in portrait or in landscape? The decision can greatly affect the way your printout looks. Wouldn't it be ...

Discover More

Excluding Values from Averaging

Calculating an average of a group of numbers is easy. What if you want to exclude a couple of the numbers from the group ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More ExcelTips (ribbon)

Unique Date Displays

Need 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 More

Counting Month Ends

When working with dates in a worksheet, you may need to do some rather esoteric calculations on those dates. This tip ...

Discover More

End-of-Month Calculations

Don't want to use the EOMONTH function to figure out the end of a given month? Here are some other ideas for discovering ...

Discover More
Subscribe

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

View most recent newsletter.

Comments

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}] (all 7 characters, in the sequence shown) 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-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


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.

Newest Tips
Subscribe

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

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.