Skip to playerSkip to main contentSkip to footer
  • 7/2/2025
Discover how to calculate age using DATEDIF function in Excel. And be able to tell the compare YEARFRAC() vs DATEDIF() functions.

Calculating age using Excel's DATEDIF function is a quick and easy way to determine the age of a person based on their birthdate. By subtracting the birthdate from the current date and specifying the "year" interval unit, the formula returns the person's age in years. It is important to use the correct format for the birthdate and to ensure that the column width is wide enough to display the result. Using Excel to calculate age is particularly useful when working with large datasets or when multiple calculations need to be performed quickly and accurately.

YEARFRAC is an Excel function that calculates the fraction of a year between two dates. By using this function, you can easily calculate a person's age in years, months, and even days. To calculate age, you simply need to subtract the person's birth date from the current date and divide the result by 365.25 (to account for leap years). This will give you the person's age in years with decimal places. You can then use the INT function to round down to the nearest whole number and obtain the person's age in years. Alternatively, you can use the DATEDIF function to calculate the number of complete years between two dates, but this function does not handle leap years as accurately as YEARFRAC.


YEARFRAC vs DATEDIF

YEARFRAC and DATEDIF are both Excel functions used to calculate the difference between two dates, but they differ in their approach and output.
DATEDIF returns the difference between two dates in the specified interval unit, such as days, months, or years. It has limitations, such as not being able to calculate fractions of a year and not working correctly in certain situations.

YEARFRAC, on the other hand, calculates the difference between two dates in terms of a fractional number of years. This function is more versatile than DATEDIF, as it can calculate the fraction of years between two dates, and it can also calculate the number of days or months between two dates.

In summary, DATEDIF is useful for calculating differences between dates in terms of specific interval units, while YEARFRAC is useful for calculating the fraction of years between two dates.


This is the formula featured on the video.
=DATEDIF(B3, TODAY(), "Y")

AND

=YEARFRAC(B11, TODAY())

Calculate age using DATEDIF in Excel,DATEDIF, YEARFRAC vs DATEDIF,
yearfrac months,yearfrac today,yearfrac vs datedif,yearfrac,yearfrac not working,yearfrac google sheets,yearfrac basis,datedif excel,
Transcript
00:00I recently made a video on calculating a person's age using yearfrag function, but a subscriber
00:05recommended using dateif function. I'm here to compare and contrast the two functions. Let's go.
00:10This is how I use a dateDif function, equal dateDif. The first argument will be the date of birth.
00:16Second argument will be today's date using today function. The third argument will be, let's say,
00:21y for age calculation as in years. And that's how you calculate age of a person using dateDif.
00:26As for yearfrag, is equal yearfrag. First argument, similar to dateDif, is date of birth.
00:32And likewise, today's date using today function. And it just uses two arguments. As you can see,
00:38yearfrag displays years in fraction, while dateDif presents years in whole numbers here. Also,
00:43likewise, dateDif you can show in either years or month since the date of birth, or also in days,
00:49while yearfrag doesn't have that capability. I've been reading a lot of articles about dateDif not
00:54doing leap year. I don't think that is true. But what do you think? Leave a comment in the description
00:58below.

Recommended