Calculate Vacation Hours from a Hire Date in Excel
Question details
Calculate an employee's vacation hours based on completed years of service and company-defined anniversary thresholds.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- An employer wants to look up vacation hours using an employee's hire date and an evaluation date.
- Observed behavior
- The formula should return 0 hours for less than one completed year and the applicable hours at each service anniversary.
Enter the hire date in C2 and the date used to evaluate service in B2 as valid Excel dates. Make sure B2 is not earlier than C2, and have your company's service thresholds and vacation-hour amounts ready.
Use DATEDIF and LOOKUP with a vacation entitlement table
Use this method when vacation hours change at specified completed-year thresholds.
DATEDIF calculates completed years between the hire date and the evaluation date. LOOKUP then returns the hours for the highest threshold that does not exceed those years.
In B10:B15, enter service-year thresholds in ascending order. Enter the corresponding vacation hours in C10:C15, starting with 0 years and 0 hours; use your company's policy for the remaining thresholds and amounts.
Enter the employee's hire date in C2 and the anniversary or other evaluation date in B2.
Select B5 and enter =LOOKUP(DATEDIF($C$2,$B$2,"Y"),$B$10:$B$15,$C$10:$C$15). Press Enter to return the applicable vacation hours.
Compare B5 with the policy table, especially for dates just before and on a service anniversary. Adjust the table entries if they do not match your policy.

Calculate Service-Based Vacation Hours in WPS Spreadsheets
Use a service-threshold table and a DATEDIF and LOOKUP formula in WPS Spreadsheets to calculate vacation hours from a hire date.
- 1. Open the spreadsheet: Open WPS Spreadsheets and create a workbook or open an existing Excel file.
- 2. Enter the dates: Enter the hire date in C2 and the evaluation date in B2.
- 3. Build the policy table: Enter ascending service-year thresholds in B10:B15 and corresponding vacation hours in C10:C15, beginning with 0 years and 0 hours.
- 4. Enter the formula: Select B5, enter =LOOKUP(DATEDIF($C$2,$B$2,"Y"),$B$10:$B$15,$C$10:$C$15), and press Enter.

Frequently Asked Questions
Why does the formula return 0 hours before the first anniversary?
DATEDIF with "Y" counts completed years, so it returns 0 before the first anniversary. The lookup table must include 0 years paired with 0 hours.
Can I use today's date as the evaluation date?
Yes. Enter =TODAY() in B2 to calculate completed service as of the current date. The result will update as the date changes.
Why does LOOKUP return the wrong vacation hours?
Check that the service-year thresholds in B10:B15 are sorted in ascending order and that each corresponding hour amount is in the same row in C10:C15.
What if the evaluation date is earlier than the hire date?
DATEDIF can return an error when the end date precedes the start date. Check that B2 contains a date on or after the hire date in C2.




