Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Calculating Fractions of Years.

# Calculating Fractions of Years

Written by Allen Wyatt (last updated August 5, 2023)
This tip applies to Excel 97, 2000, 2002, and 2003

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. This function is part of the Analysis ToolPak provided with Excel.

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

You should note that if the YEARFRAC function does not work on your system, it means you have not installed or enabled the Analysis ToolPak. To enable it, follow these steps:

2. Make sure the Analysis ToolPak option is selected.
3. Click on OK.

If you did not see an Analysis ToolPak option in step 2, it means that you did not install the option when you first installed Excel. You can rerun the Excel Setup program and choose to install the option. You must then enable the add-in, and you can use the function.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2562) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) 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

The Zoom tool is very useful to help you see all of your document information. Here's how to make sure you can see all ...

Discover More

You can update fields and links automatically when you print your document, but what if you want them updated when you ...

Discover More

Counting All Characters

Need to know how many characters there are in a workbook? You can find out easily with the handy macro introduced in this ...

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!

Numbers in Base 12

Different professions use numbers in entirely unique ways. You may need to come up with a number that represents the ...

Discover More

Returning a Blank Value

Is it possible for a formula to return a blank value? It depends on how you define your terms. This tip examines all the ...

Discover More

Excel allows you to easily convert values from decimal to other numbering systems, such as hexadecimal. This tip explains ...

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}] (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 eight more than 7?

There are currently no comments for this tip. (Be the first to leave your commentâ€”just use the simple form above!)

##### This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.