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

Adding a Comment to Multiple Cells

Adding a comment to a single cell is easy. What if you want to add the same comment to multiple cells, however? Here are ...

Discover More

Using Stored Views

After creating different views of your worksheet data, you can display those views by simply selecting which one you want ...

Discover More

Automatic Initial Capitals in Tables

Have you ever started typing words in a table, only to find that Word automatically capitalizes the first word in each ...

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)

Elapsed Days as Years, Months and Days

Need to know how many days there are between two dates? It's easy to figure out—unless you need the figure in ...

Discover More

Entering Dates without Separators

When doing data entry into a worksheet, you might want to enter dates without the need to type the separators that are ...

Discover More

Adding Ordinal Notation to Dates

Want to add an ordinal suffix to a number, as in 2nd, 3rd, or 4th? Excel doesn't provide a way to do it automatically, ...

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 four minus 0?

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.