Skip to main content

Age Formula in Excel: Easy Methods for Age Calculation

Learn how to calculate age in Excel using simple, accurate formulas. Discover methods with DATEDIF(), YEARFRAC(), and INT() functions to handle birthdays, specific dates, and special cases.
May 5, 2025  · 7 min read

Calculating age in Excel is a common task for HR professionals managing employee records, researchers analyzing survey data, or anyone maintaining personal datasets. While Excel doesn't include a dedicated "AGE" function, several straightforward formulas can help you determine someone's age with precision. This guide will walk you through various methods to calculate age in Excel, from simple approaches to more detailed formulas that can give you exact years, months, and days.

For those new to Excel, our Introduction to Excel course covers essential skills like navigating the interface, understanding data formats, and working with basic functions. If you're looking to expand your analytical capabilities beyond age calculations, our Data Analysis in Excel course teaches you how to work with PivotTables and advanced logical functions for deeper insights. 

Basic Age Formula in Excel

The simplest way to calculate age in Excel involves subtracting the birth date from today's date and dividing by 365. For example, if cell A2 contains a birth date, you could use:

=(TODAY()-A2)/365

This formula gives you the age in years with a decimal component representing partial years. While this approach is easy to implement, it's not always accurate. The division by 365 doesn't account for leap years, which can lead to small errors that accumulate over time. Additionally, this method doesn't handle varying month lengths properly.

For example, using this formula for someone born on January 15, 1990, might show 35.3 years instead of exactly 35 years and 3 months. This discrepancy becomes more noticeable as the time span increases, making it less ideal for precise age tracking or legal documentation.

Accurate Age Calculation Methods

Using INT() and YEARFRAC() for better accuracy

The YEARFRAC() function can offer improved precision when calculating ages, but its accuracy depends on how you use it. While YEARFRAC() can account for leap years and varying month lengths, this depends on the optional basis parameter: 

=INT(YEARFRAC(A2,TODAY(),1))

Each component serves a specific purpose:

  • YEARFRAC(start_date, end_date, basis) calculates the fraction of years between two dates

  • The basis parameter (1) tells Excel to use actual days in calculations

  • TODAY() provides the current date

  • INT() removes the decimal portion, giving only completed years

Without specifying the basis parameter, YEARFRAC() defaults to basis=0 (U.S. 30/360), which treats each month as having 30 days and doesn't account for actual month lengths or leap years. Setting basis=1 tells Excel to use the actual/actual method, where the actual days in each month and year are used in the calculation.

This method is preferred for most scenarios due to its balance of simplicity and accuracy. For instance, if someone was born on March 15, 1995, this formula would correctly show their age in completed years.

Using DATEDIF() for exact age

The DATEDIF() function (Date Difference) is specifically designed to calculate time intervals between dates. For calculating age in completed years, use:

=DATEDIF(A2,TODAY(),"Y")

The "Y" parameter instructs Excel to count only completed years. This function gives you the number of full years precisely and works well when you need a clean integer result. The benefit of DATEDIF() is its precision—it only counts a year once it's fully completed, making it perfect for official age calculations.

Using multiple DATEDIF() functions

This method can help you calculate exact age in years, months, and days by combining three DATEDIF() functions:

For years:

=DATEDIF(A2,TODAY(),"Y")

For months beyond the last completed year:

=DATEDIF(A2,TODAY(),"YM")

For days beyond the last completed month:

=DATEDIF(A2,TODAY(),"MD")

To display them together in a single cell:

=DATEDIF(A2,TODAY(),"Y")&" years, "&DATEDIF(A2,TODAY(),"YM")&" months, "&DATEDIF(A2,TODAY(),"MD")&" days"

This method creates a clear, detailed age breakdown. For cleaner display, you can add IF statements to hide zero values:

=IF(DATEDIF(A2,TODAY(),"Y")=0,"",DATEDIF(A2,TODAY(),"Y")&" years, ")&IF(DATEDIF(A2,TODAY(),"YM")=0,"",DATEDIF(A2,TODAY(),"YM")&" months, ")&IF(DATEDIF(A2,TODAY(),"MD")=0,"",DATEDIF(A2,TODAY(),"MD")&" days")

This formula shows "35 years, 3 months, 18 days" instead of "35 years, 0 months, 0 days" when appropriate.

Special Use Cases for Age Calculation

Calculating age on a specific date

Sometimes you need to calculate age on a date other than today, such as a future hiring date or a historical point in time. To modify the formulas for a specific reference date, simply replace TODAY() with your target date:

=DATEDIF(A2,DATE(2024,12,31),"Y")

This formula calculates how old a person will be on December 31, 2024. Similarly, for a complete age breakdown on a specific date:

=DATEDIF(A2,DATE(2024,12,31),"Y")&" years, "&DATEDIF(A2,DATE(2024,12,31),"YM")&" months, "&DATEDIF(A2,DATE(2024,12,31),"MD")&" days"

This approach is useful for HR planning, insurance calculations, or analyzing historical data points.

Calculating age in a certain year

When only a year is given and you need to calculate someone's age in that year, you can use the DATE() function to set month and day values:

=DATEDIF(A2,DATE(2030,12,31),"Y")

Or for mid-year calculations:

=DATEDIF(A2,DATE(2030,6,30),"Y")

This helps with long-term planning scenarios where exact dates aren't needed, just the age in a particular year.

Finding the date when a person reaches a certain age

To find the date when someone turns a specific age (like retirement eligibility), use:

=DATE(YEAR(A2)+65,MONTH(A2),DAY(A2))

This formula adds 65 years to their birth date to find when they'll turn 65. The result is an Excel date value showing exactly when they'll reach that milestone.

For more complex scenarios where you need to find when someone reaches a certain age plus months:

=DATE(YEAR(A2)+30,MONTH(A2)+6,DAY(A2))

This formula finds when someone will be 30 years and 6 months old, which can be useful for eligibility requirements with both year and month specifications.

Highlighting Ages Based on Age Thresholds

Conditional formatting provides a visual way to identify ages that fall into specific categories. While these formulas would return TRUE or FALSE if entered directly in cells, when used in conditional formatting, they automatically apply your chosen formatting styles instead.

Highlight under 18

To set up conditional formatting that highlights cells containing individuals under 18 years old:

  1. Select your data range
  2. Go to HomeConditional FormattingNew Rule
  3. Choose Classic under Style
  4. Choose Use a formula to determine which cells to format
  5. Enter this formula:
=DATEDIF(A2, TODAY(), "Y")<18

6.   Click Format and select your desired highlighting style (color, font, etc.)

When this rule is applied, Excel evaluates the formula for each cell. If the result is TRUE (the person is under 18), Excel applies your chosen formatting automatically.

Highlight between 18 and 65

For identifying working-age individuals:

  1. Follow the same steps as above
  2. Use this formula in the conditional formatting rule:
=AND(DATEDIF(A2, TODAY(), "Y")>=18, DATEDIF(A2, TODAY(), "Y")<=65)
  1. Choose a different formatting style for this group

Highlight over 65

To identify seniors who may qualify for retirement benefits:

  1. Create another conditional formatting rule
  2. Use this formula:
=DATEDIF(A2, TODAY(), "Y")>65
  1. Apply a third distinct formatting style

The advantage of using conditional formatting is that it works behind the scenes - your actual cell values remain unchanged while Excel applies visual cues based on your rules.

Key Points to Remember

When calculating ages in Excel, keep these important tips in mind:

  • Use DATEDIF() or YEARFRAC() for optimal accuracy. DATEDIF() is built specifically for date differences, while YEARFRAC() with basis=1 accounts for actual calendar days.

  • Use INT() or ROUNDDOWN() functions to avoid decimal values when you need whole numbers. This ensures you get completed years rather than partial years with decimal points.

  • Watch out for leap years and different month lengths. The basic formula (dividing by 365) doesn't account for these variations, leading to small inaccuracies over time.

  • Make sure date formats are correct. Excel needs to recognize your dates as true date values, not text. If your formulas return unexpected results, check that your dates are properly formatted as dates in Excel.

  • For date calculations in large datasets, consider storing your formulas as named ranges or creating a dedicated calculation sheet. This makes your worksheets more maintainable and easier to update.

  • Test your age calculations with known examples to verify accuracy. Try calculating ages for people born on leap days (February 29) or near month boundaries to ensure your formulas handle edge cases correctly.

Conclusion

Calculating age in Excel is straightforward once you select the right method for your needs. For basic applications, the DATEDIF() function offers a clean, accurate solution. For more detailed analyses, combined formulas can provide exact breakdowns in years, months, and days.

For large datasets, you can automate these calculations by embedding formulas into templates or utilizing Excel's more advanced tools like Power Query. This automation is especially helpful for HR databases or demographic studies where thousands of records may need age calculations.

If you're looking to develop a more comprehensive set of Excel skills that extends beyond age calculations, our Excel Fundamentals skill track provides a structured learning path that takes you from basic functions to advanced data analysis techniques. By choosing the right formula based on your specific requirements, you can ensure your age calculations remain precise and reliable, whether you need basic age values, detailed breakdowns, or specialized analysis for specific dates and thresholds.

Advance Your Career with Excel

Gain the skills to maximize Excel—no experience required.

Start Today for Free

Vinod Chugani's photo
Author
Vinod Chugani
LinkedIn

As an adept professional in Data Science, Machine Learning, and Generative AI, Vinod dedicates himself to sharing knowledge and empowering aspiring data scientists to succeed in this dynamic field.

FAQs

Why doesn't Excel have a dedicated function to calculate age?

Excel relies on its versatile date calculation functions like DATEDIF(), YEARFRAC(), and DATE() rather than creating specialized functions. These existing functions provide flexibility to handle various age calculation scenarios.

My age calculations are showing as text or wrong values. What's happening?

Check that your dates are formatted as actual Excel dates, not text. Select the cells, right-click, choose Format Cells, and set them to an appropriate date format.

Do Excel's age calculation formulas handle birthdays on February 29th correctly?

Yes, both DATEDIF() and YEARFRAC() properly handle leap years and February 29th birthdays. In non-leap years, Excel treats February 29th birthdays as occurring on March 1st for accurate age calculations.

Can I create dynamic age calculations that update automatically?

Yes, formulas using TODAY() automatically recalculate whenever you open the spreadsheet. For a truly dynamic solution that updates even between openings, consider using Excel's Data Model with Power Query, which refreshes data on a schedule.

How do Excel's age calculations handle different international date formats?

Excel automatically uses your system's date format settings for display, but internally stores dates as serial numbers. When entering dates directly, use your system's format (MM/DD/YYYY in the US or DD/MM/YYYY in many other countries), but when using the DATE() function, always use the order: DATE(year, month, day).

Topics

Learn with DataCamp

Track

Excel Fundamentals

16hrs hr
Gain the essential skills you need to use Excel, from preparing data to writing formulas and creating visualizations. No prior experience is required.
See DetailsRight Arrow
Start Course
See MoreRight Arrow
Related

Tutorial

How to Calculate Days Between Dates in Excel: The 5 Best Ways

Explore simple subtraction for quick and effortless date calculations. Apply the DAYS() and DATEDIF() functions to achieve precise date intervals. Use NETWORKDAYS() and TODAY() to track working days and automatically exclude weekends and holidays.
Laiba Siddiqui's photo

Laiba Siddiqui

5 min

Tutorial

CAGR Excel Formula: A Comprehensive Guide

Discover how to calculate the compound annual growth rate (CAGR) in Excel. Learn practical applications and advanced techniques to enhance your data analysis skills.
Arunn Thevapalan's photo

Arunn Thevapalan

9 min

Tutorial

Excel Compound Interest Formula: A Comprehensive Guide

Learn to use Excel to calculate compound interest along with practical techniques and real-world applications to enhance your financial analysis skills.
Arunn Thevapalan's photo

Arunn Thevapalan

9 min

Tutorial

The 15 Basic Excel Formulas Everyone Needs to Know

Learn how to add arithmetic, string, time series, and complex formulas in Microsoft Excel.
Abid Ali Awan's photo

Abid Ali Awan

15 min

Tutorial

Rank Formula in Excel: A Comprehensive Guide With Examples

Learn how to rank data in Excel with RANK(), RANK.EQ(), and RANK.AVG() functions. Understand their differences, applications, and tips for accurate data analysis.
Laiba Siddiqui's photo

Laiba Siddiqui

11 min

Tutorial

DATEDIFF() SQL FUNCTION

DATEDIFF() is one of the most widely used date data manipulation functions in SQL. Master it by reading this tutorial.
Travis Tang 's photo

Travis Tang

3 min

See MoreSee More