What can the DATEDIF Function Help You Calculate in the Excel


DATEDIF function is very useful, it’s the easiest way to calculate any kind of date comparisons in a breeze.

For example, you are asked to show employee ages in a Excel file, do you know how? DATEDIF can help you in seconds. You can enter a formula like this:


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


The DATEDIF function can calculate the number of the days, months, years, between two dates. it requires three arguments, a start date, an end date, and a time unit. The DATEDIF time codes are:

  • “y” The number of complete years
  • “m” The number of complete months
  • “d” The number of¬† days
  • “md” Difference in days, ignoring months and years
  • “ym” Difference in months, ignoring years
  • “yd” Difference in days, ignoring years

Using the above time codes, you can do various manipulation between two dates.

For the age questions above, you can find the age in years, months and days using these respective formulas:

  • =DATEDIF(“8/15/1964″,TODAY(),”y”)
  • =DATEDIF(“8/15/1964″,TODAY(),”m”)
  • =DATEDIF(“8/15/1964″,TODAY(),”d”)

The formula¬†=DATEDIF(“8/15/1964″,TODAY(),”d”) can also be used to calculate the number of days between two dates.


Comments are closed.