How to Calculate Age in Excel [Formulas with Examples]

Written By Farhan Bin Matin

Excel allows you to automate the age calculation process, eliminating the need for manual updates and reducing the risk of errors. Additionally, its formatting options can display the age in various formats.

For personal record-keeping or professional data analysis, Excel provides a quick and efficient way to calculate and manage age-related information.

In this article, I’ll explain different Excel functions & formulas to calculate age, with easy-to-understand examples for each technique.how-to-calculate-age-in-excel

Let’s begin!

How to Calculate Age Using a Date of Birth in Excel

In Microsoft Excel, you can employ several functions to calculate age based on date information accurately. One of them is the TODAY function. It is a dynamic feature that automatically updates the current date, allowing for real-time age calculations.

Additionally, the YEARFRAC function offers a more flexible approach, providing a fraction of a year between two dates. This function is beneficial when dealing with partial years, as it calculates the age with a decimal point, offering a more detailed result.

Moreover, the DATEDIF function is a versatile tool designed explicitly for date-related calculations.

Below, I’ve explained how to use all these different functions in detail.

Here are the methods to calculate age using a date of birth in MS Excel:

1. Use the TODAY Function

In Excel, you can use the TODAY function to get the current date and the INT function to round down a decimal to the nearest integer. By subtracting the birthdate from the current date and applying the INT function, you can calculate the age in years.

Here’s a breakdown of the formula:

=INT((TODAY()-B2)/365.25)

Here, TODAY() is the function that returns the current date. B2 is the cell reference containing the birthdate of the person. 365.25 is used instead of 365 to account for leap years, as there is an extra 0.25 days in a leap year, and the INT function rounds the result to the nearest integer.

Suppose you have a spreadsheet with the birth dates in column B and want to calculate the ages in column C.

Here’s how you can set it up:excel-calculate-age-today-function

2. Apply the YEARFRAC Function

The YEARFRAC function in Excel calculates the fractional number of years between a specified date and the current date. This function determines a person’s age based on their birthdate.

Let’s break down the components of the YEARFRAC function:

=YEARFRAC(B2, TODAY(), 1)

Here, B2 refers to the cell containing the birthdate, TODAY() is the function that returns the current date, and 1 specifies the day count basis. In this case, 1 represents the actual number of days in a month and the actual number of days in a year.

You can use other values, such as 0 for the US (NASD) 30/360 method, 2 for actual/360, 3 for actual/365, and 4 for the European 30/360 method.

Let’s assume you have a spreadsheet with Column A containing the names of individuals and Column B containing their respective dates of birth.

Column C is where you can enter the =YEARFRAC(B2, TODAY(), 1) formula for calculating the age based on the birthdate in cell B2.excel-calculate-age-yearfrac-functionWhen you enter the formula in cell C2 and copy it for other rows, it will calculate each person’s age based on their birthdate. The result will be a fractional number representing the number of years.

If you want to display the age as a whole number, you can use the ROUND function, like this: =ROUND(YEARFRAC(B2, TODAY(), 1), 0).excel-calculate-age-yearfrac-round-function

3. Utilize the DATEDIF Function

The DATEDIF function in Excel calculates the difference between two dates in various units, such as years, months, or days.

Using this function, you can construct a formula in the following manner to calculate the difference in years between the date in cell B2 and the current date:

=DATEDIF(B2, TODAY(), “y”)

Here, B2 refers to the starting date; in this case, the birthdate in cell B2, TODAY() returns the current date, and “y” is the unit for which you want to calculate the difference, in this example, years.

Let’s create a worksheet in Excel where Column A contains an ID for each individual, Column B contains the date of birth for each person, and Column C contains the DATEDIF formula to calculate the age based on the date of birth in column B and the current date.excel-calculate-age-datedif-function

Use DATEDIF to Get Age from Birthday in Years, Months and Days

You can add IF conditions to the DATEDIF function to calculate someone’s age in years, months, and days.

Below, I’ve provided the formula:

=IF(DATEDIF(B2, TODAY(),”y”)=0,””,DATEDIF(B2, TODAY(),”y”)&” years, “)& IF(DATEDIF(B2, TODAY(),”ym”)=0,””,DATEDIF(B2, TODAY(),”ym”)&” months, “)& IF(DATEDIF(B2, TODAY(),”md”)=0,””,DATEDIF(B2, TODAY(),”md”)&” days”)

The formula uses three IF statements, each checking if the calculated difference in years, months, or days is non-zero. If the difference is non-zero, it includes that part in the final result; otherwise, it adds an empty string.

Suppose you have a spreadsheet with the birth dates in Column B and want to calculate the ages in Column C. Use the formula in Column C to divide the calculated age into years, months, and days.excel-divide-age-datedif-function

Apply DATEDIF to Calculate Age from Year, Month, and Day in Different Cells

If you work with an Excel spreadsheet where the date of birth has dedicated cells for year, month, and day, you can still modify the DATEDIF function to calculate the age.

Here’s how the formula is written:

=DATEDIF(DATE(B3, MONTH(DATEVALUE(C3&”1″)), D3), TODAY(), “y”) & ” Years, “& DATEDIF(DATE(B3, MONTH(DATEVALUE(C3&”1”)), D3),TODAY(), “ym”) & ” Months, “&  DATEDIF(DATE(B3, MONTH(DATEVALUE(C3&”1”)), D3), TODAY(), “md”) & ” Days”

Formula breakdown:

  • DATE(B3, MONTH(DATEVALUE(C3&”1″)), D3): This part creates a date by combining the year in cell B3, the month in cell C3, and the day in cell D3.
  • TODAY(): This function returns the current date.
  • DATEDIF(start_date, end_date, “y”): Calculates the difference between two dates in years.
  • DATEDIF(start_date, end_date, “ym”): Calculates the difference between two dates in months, ignoring the years.
  • DATEDIF(start_date, end_date, “md”): Calculates the difference between two dates in days, ignoring the years and months.

Suppose you have the following data in an Excel spreadsheet:excel-birthdate-data

Now, you can use the provided formula in column E to calculate the age.excel-calculate-age-different-columns-datedif-function

Utilize DATEDIF to Calculate Age on a Specific Date

You can also customize the DATEDIF function to find the age from someone’s birthday to a particular date.

Here’s how the modified formula looks like:

=DATEDIF(B2, C2, “Y”) & ” Years, ” & DATEDIF(B2, C2, “YM”) & ” Months, ” & DATEDIF(B2, C2, “MD”) & ” Days”

In the formula, B2 and C2 are the cell references for the two dates you want to compare. “Y” calculates the difference in years, “YM” calculates the difference in months, and “MD” calculates the difference in days.

The formula concatenates the results of these three DATEDIF functions to form a text string representing the age difference in years, months, and days.

Let’s assume you have a spreadsheet with Column A containing the names of individuals, Column B containing their respective dates of birth, and Column C containing specific dates.

Now, enter the formula in cell D2 to calculate the age based on the provided dates.excel-calculate-age-to-specific-date

Use DATEDIF to Calculate Age in a Certain Year

With the DATEDIF function, you can easily find out the age based on the birthdate you’ve specified in a cell in an Excel spreadsheet.

Here’s the formula:

=DATEDIF(B2, DATE(C2, 1, 1), “y”)

Here, B2 is the cell containing the birthdate. DATE(C2, 1, 1) creates a new date using the year specified in cell C2 and the month and day set to 1, referring to the first day of the specified year. “y”is the unit for which you want to calculate the difference. In this case, “y” stands for years.

Let’s assume you have a spreadsheet with Column A containing the names of individuals, Column B containing their respective dates of birth, and Column C containing a certain year.

Now, enter the formula I’ve described in cell D2.excel-calculate-age-specific-year

Why You Should Use Microsoft Excel to Calculate Age?

Excel is invaluable for calculating age due to its user-friendly interface, powerful mathematical functions, and efficient data management capabilities. The program offers a variety of date and time functions that simplify age calculations.

The DATEDIF function, for instance, provides a straightforward method to compute the difference in years, months, or days between two dates. It makes age calculation easy and precise.

Excel’s flexibility enables users to handle large datasets efficiently, making it ideal for scenarios where you need to calculate age for multiple individuals.

Additionally, the program’s ability to update calculations automatically ensures accuracy, especially in dynamic datasets where ages change over time.

Furthermore, Excel’s compatibility with other Microsoft Office applications facilitates seamless integration, allowing users to incorporate age calculations into reports, presentations, or databases with ease.

So, it’s safe to say that Excel simplifies the age calculation process, providing accuracy, automation, and ease of use.

Final Thoughts

As you can see, by utilizing several functions, you can easily determine an individual’s age based on their birthdate and the current date. This efficiency makes Excel irreplaceable for managing age-related data.

Comment below if you have further questions, and we’ll get back to you.

About The Author
Farhan is a tech researcher and enthusiast. He’s been into tech and gaming since he got a PS2 in his childhood.Currently, he’s almost done with his undergrad.Besides testing and researching geeky stuff, Farhan has an utmost passion for photography.

Leave a Comment