Use the YEARFRAC function to calculate ages of employees using Microsoft Excel
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->.
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->.
Use the YEARFRAC function to calculate ages of employees |
No comments:
Post a Comment