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: Displaying a Number as Years and Months.

Displaying a Number as Years and Months

by Allen Wyatt
(last updated January 6, 2018)

3

Robert has a formula that determines the payback period for certain investments. For instance, with $20,000 investment in energy-savings equipment and an annual energy savings of $3000, the simplistic payback period to recoup the investment is 6.6667 years. Robert wonders how he can make this payback period (6.6667) show as years and months instead of as a decimal number.

This can be done by simply multiplying the portion of the answer at the right of the decimal point by 12, which results in a number of months. Here is one way to get the desired result, assuming that the payback result is in cell A1:

=INT(A1) & " years / " & INT((A1-INT(A1))*12) & " months"

With the value 6.6667 in cell A1, the formula would return “6 years / 8 months”.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (12485) 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: Displaying a Number as Years and Months.

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

Offering Options in a Macro

When creating macros, you often need to offer a series of choices to a user. This tip demonstrates how easy it is to ...

Discover More

Converting an Unsupported Date Format

Excel makes it easy to import information created in other programs. Converting the imported data into something you can ...

Discover More

Changing Paper Size for a Complete Workbook

If you need to change the size of paper on which your worksheets will be printed, it can be bothersome to make the change ...

Discover More

Professional Development Guidance! Four world-class developers offer start-to-finish guidance for building powerful, robust, and secure applications with Excel. The authors show how to consistently make the right design decisions and make the most of Excel's powerful features. Check out Professional Excel Development today!

More ExcelTips (ribbon)

The Last Business Day

Many businesses need to know when the last business day of the month occurs. This tip discusses several ways you can ...

Discover More

Rounding to the Nearest Quarter Hour

When entering times in a worksheet, you may have a need to round whatever you enter to the nearest 15-minute increment. ...

Discover More

ISO Week Numbers in Excel

Work in an industry that uses ISO standards when it comes to working with dates? You'll love the formula in this tip ...

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}] 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 8 + 1?

2018-03-20 08:32:07

Dave Shepherd

This example should use ROUNDUP function for months section as payback is calculated in full month; INT always rounds down, it basically works the same way as ROUNDDOWN(A1,0). This also would fix the negative issue if you replace all of the INTs with ROUNDDOWN, ROUND or ROUNDUP as appropriate

If you need completed months only
=INT(A1) & " years / " & INT((A1-INT(A1))*12) & " months"

If you need to nearest months
=INT(A1) & " years / " & ROUND((A1-INT(A1))*12,0) & " months"

If you need to count part month as complete month (as in the example given)
=INT(A1) & " years / " & ROUNDUP((A1-INT(A1))*12,0) & " months"


2018-02-18 06:27:37

Willy Vanhaelen

@DREW
You are right, months are not in tenths but the formula doesn't do that. Try with 6.92 and you get 6 years / 11 months. So the formula is all right BUT ONLY FOR POSITIVE NUMBERS. For positive as well as negative numbers use this formula:

=TRUNC(A1) & " years / " & TRUNC((A1-TRUNC(A1))*12) & " months"


2018-02-17 17:09:31

DREW

NO. THIS WRONG! MONTHS ARE NOT IN TENTHS!


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.