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: Ages in Years and Months.

Ages in Years and Months

Written by Allen Wyatt (last updated September 21, 2022)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365


5

Many times, in early childhood education, a child's age in Years.Months format is needed for reporting, admitting, and evaluation. Basically, this format shows the number of elapsed years and months since birth, separated by a period.

There are several ways you can go about getting the desired age. The formula you choose to do the work depends, quite literally, on your preference in formulas.

Assuming that you have the birth date in cell A1, you might think you could use some math on the date to determine the proper information. For instance, you might think that you could use this formula:

=NOW() - A1

This produces a value that is the difference between the two dates, but if you then apply a custom format ("yy.mm") to the result, you'll find out that it doesn't give the sought-after Years.Months. You get something close; the years are right, but the months vary from 1 to 12 when they should vary from 0 to 11. (Somebody can be 12 years and 0 months old, but it is not proper to say 12 years and 12 months old.)

This means that you need to start casting about for a formulaic approach. A simple formula would be the following:

=YEAR(NOW())-YEAR(A1) & "." & MONTH(NOW())-MONTH(A1)

There are many variations on the above, but the problem is that they all only look at the month of today compared to the month of the birthdate; they don't take the day of the month into account. What is that important? Because the number of elapsed months since birth is dependent on how the day of the birth month compares to the day of the present month, and the formula doesn't allow for that distinction.

So, you might consider a more complex formula that actually tries to calculate elapsed years and months, such as the following one:

=TEXT(INT((NOW()-A1)/365.25),"##0")&"."&TEXT(INT(MOD(NOW()-A1,365.25)/31),"00")

This comes much closer to what is needed, but it is still possible to be off by a day or two right around the time of the month when the birth day is approached. Closer still is a formula which uses the YEARFRAC function:

=ROUNDDOWN(YEARFRAC(A1,TODAY()),0)&"."&ROUNDDOWN((YEARFRAC(A1,TODAY())-ROUNDDOWN(YEARFRAC(A1,TODAY()),0))*12,0)

The best (and simplest) formulaic approach, however, is this one:

=DATEDIF(A1,NOW(),"y") & "." & DATEDIF(A1,NOW(),"ym")

The formula relies on the DATEDIF function, which determines the difference between two dates. The value returned by the function depends on the third parameter passed to the function. In this case, the first invocation of DATEDIF returns the number of elapsed years and the second returns the number of elapsed months. It provides the most accurate results of any of the formulas discussed so far.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (9148) 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: Ages in 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

Copying Paragraph Formatting with the Mouse

When you get one paragraph formatted just the way you want, you might want to copy that formatting so it can be applied ...

Discover More

Transferring Ribbon Customizations

Excel allows you to make a wide range of customizations to both the Quick Access Toolbar and the ribbon. If you want to ...

Discover More

Numbering Only Certain Lines

Need to add line numbers to a document? Word provides an easy way to add them, but some of the controls that configure ...

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)

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

Leap Years and Fiscal Periods

Need to figure out when a fiscal year ends when that period does not correspond to the calendar year? Here are some ways ...

Discover More

Calculating Business Days

There are calendar days and then there are business days. Excel provides two functions (NETWORKDAYS and NETWORKDAYS.INTL) ...

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 five less than 5?

2021-08-03 10:46:08

J. Woolley

You can also use the TimeDif(Start, Finish, [Approximate], [Conversational]) function in My Excel Toolbox. For Peter Atherton's example:

=TimeDif(C1,C2,FALSE,FALSE) gives the following result:
23 yr 09 mth 25 day 00 hr 00 min 00 sec

=TimeDif(C1,C2,FALSE,TRUE) gives the following result:
23 years 9 months and 25 days

=TimeDif(C1,C2,TRUE,FALSE) gives the following result:
almost 24 years

And if C2 is replaced by the following formula:
=DATE(2021,7,26)+NOW()-TODAY(), then at 10:35:05 am
=TimeDif(C1,C2,FALSE,FALSE) gives the following result:
23 yr 09 mth 25 day 10 hr 35 min 05 sec

See https://sites.google.com/view/MyExcelToolbox/


2021-08-03 00:09:05

Peter

The Datedif() function looks like it could be useful. Thanks for alerting me.
I would not have found it otherwise, since it does not appear in the list of functions on the "Insert Function" dialog.


2021-07-28 16:07:07

Peter Atherton

Peter

How about this?

(see Figure 1 below)

Figure 1. 


2021-07-26 07:59:06

Peter Molnar

Hi, thanks for the formula to calculate kids' ages in years and months. So handy for a school teacher! Only question I have is how can I modify it to calculate a student's age in years and months as at a future date? for example today is July 26th, 2021 and I need the calculation date to be for argument's sake October 9? I don't want to have to manually scrutinise my spreadsheet and adjust individually. What would the correct syntax be for that formula?


2020-10-19 13:00:33

Andre Basson

Hi Allen
Just used your "Ages in Years and Months" solution and it worked (as is normally the case with your solutions), but not if the birthday is on the last day of the month (or presumably later than the 28th. Used it in retirement planning and mine is on the 31st August. Answer was correct on months wit 31 days but one month short on all the others. Changing the birthdate to the 28 fixed it. Not seriou, but thiught you may know how to fix it without having to go to too much trouble.
Regards
A


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.