How to Calculate Age in Excel ?

Spread the love

In this post you will learn how to calculate age in Excel.

Calculating age –

One of the easiest ways to calculate the age of anything is to use Excel’s DATEDIF function.
This function makes calculating any kind of date comparisons a breeze.

To calculate a person’s age using the DATEDIF function, you can enter a formula like this:

=DATEDIF("7/26/1989",TODAY(),"y")

You can, of course, reference a cell that contains a date:

=DATEDIF(B4,TODAY(),"y")

The DATEDIF function calculates the number of days, months, or years between two dates.
It requires three arguments—a start date, an end date, and a time unit.

The time units are defined by a series of codes listed in Table below.

CodeWhat it returns
“y”The number of complete years in the period.
“m”The number of complete months in the period
“d”The number of days in the period.
“md”The difference between the days in start_date and end_date. The months and years of the dates are ignored.
“ym”The difference between the months in start_date and end_date. The days and years of the dates are ignored.
“yd”The difference between the days of start_date and end_date. The years of the
dates are ignored.

Using these time codes, you can easily calculate the number of years, months, and days
between two dates. If someone was born on July 26, 1989, you could find that person’s age
in years, months, and days using these respective formulas:

=DATEDIF("7/26/1989",TODAY(),"y")
=DATEDIF("7/26/1989",TODAY(),"m")
=DATEDIF("7/26/1989",TODAY(),"d")

Rating: 1 out of 5.

Leave a Reply