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:
- In column A list the names of employees.
- In column B enter their birthdays.
- Select cells C2:C10 and type the formula TODAY().
- Press Ctrl+Enter.
- Select cells D2:D10 and type the following formula: =YEARFRAC(B2,C2,0).
- Press Ctrl+Enter.
- How to Use the DATEDIF function to calculate the ages of employees
- How to Calculate the number of employees needed for a project
- Use the DAYS360 function to calculate with a 360-day year
- Use the NETWORKDAYS function to determine number of workdays
- How to use the WORKDAY function to calculate workdays in Excel
