Fresh Excel Tips

Quick and Easy Excel Tips and Tutorials

How to Use the DATEDIF function to calculate the ages of employees

To calculate the exact age of employees, use the undocumented DATEDIF function from the Analysis ToolPak add-in. This function calculates the exact number of years, months, and days between two dates. The syntax is:

DATEDIF(start_date, end_date, format)
start_date: The start date.
end_date: The end date.
format: Indicates the format to use. “y” gives the difference in years; “m” in months; “d” in days; “ym” the difference in months, ignoring the year; “yd” in days, ignoring the year; and “md” in days, ignoring the month and year.

To calculate the ages of employees:

  1. In column A list the names of employees.
  2. In column B enter their birthdays.
  3. Select cells C2:C10 and type the formula TODAY().
  4. Press Ctrl+Enter.
  5. Select cells D2:D10 and type the following formula:
    =DATEDIF(B2,C2,”Y”) & ” years and ” & DATEDIF(B2,C2,”YM”) & ” months”.
  6. Press Ctrl+Enter.

How to Use the DATEDIF function to calculate the ages of employees

How to Use the DATEDIF function to calculate the ages of employees
  1. How to Use the YEARFRAC function to calculate employees ages
  2. How to Calculate the number of employees needed for a project
  3. How to Use the QUARTILE function to calculate the quartiles
  4. How to Use the SYD function to calculate depreciation in Excel
  5. How to use the WORKDAY function to calculate workdays in Excel

Leave a Reply