Fresh Excel Tips

Quick and Easy Excel Tips and Tutorials

How to Use the YEARFRAC function to calculate employees ages

To calculate the difference between two dates, use the YEARFRAC function from the Analysis ToolPak add-in. This function calculates the fraction of the year represented by the number of whole days between start_date and end_date. The syntax is:

YEARFRAC(start_date, end_date, basis)
start_date: The start date.
end_date: The end date.
basis: Count basis to use. 0 or omitted = U.S. (NASD) 30/360, 1 = actual/actual, 2 = actual/360, 3 = actual/365, or 4 = European 30/360.

To calculate the age of employees based on the current date:

  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: =YEARFRAC(B2,C2,0).
  6. Press Ctrl+Enter.

How to Use the YEARFRAC function to calculate employees ages

How to Use the YEARFRAC function to calculate employees ages
  1. How to Use the DATEDIF function to calculate the ages of employees
  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