How to Count Vacation Days Across Sheets Based on Hire Date in Excel
Question details
The user needs a spreadsheet formula to aggregate and count vacation days taken by employees across multiple individual timesheets, with the count automatically resetting annually on each employee's specific hire date anniversary.

- Product
- Spreadsheet
- Device & OS
- not provided
- Scenario
- Managing employee HR data and tracking annual leave limits based on individual work anniversaries rather than a standard calendar year.
- Observed behavior
- Requires a dynamic formula that correctly references different sheet names and calculates date boundaries dynamically per employee.
Ensure that each employee's timesheet tab is named exactly as it appears in your summary list, and that the dates of vacation taken are consistently formatted in a specific column on those sheets.
Calculate Vacation Days Using COUNTIFS and INDIRECT
Use a combination of COUNTIFS, INDIRECT, and DATE functions to dynamically reference employee sheets and filter dates between their work anniversaries.
This method relies on the INDIRECT function to pull data from different sheets based on the employee's name in your summary sheet. The COUNTIFS function then checks the dates in the timesheets against the calculated anniversary dates.
By establishing a 'Year of Service' input cell, you can easily shift the calculation window to check previous or future anniversary years without modifying the core formula for each employee.
In your summary sheet, list the Employee Names in column A (e.g., cell A3) and their original Hire Dates in column B (e.g., cell B3). Ensure the employee names exactly match the names of their individual timesheet tabs.
Create a cell, for example B1, where you input the year of service you want to calculate (e.g., enter 1 for the first year of employment, 2 for the second year). Lock this reference using absolute cell references like $B$1.
In the cell where you want the vacation count (e.g., C3), enter the following formula: =COUNTIFS(INDIRECT("'"&A3&"'!A2:A5"),">="&DATE(YEAR(B3)+$B$1-1,MONTH(B3),DAY(B3)),INDIRECT("'"&A3&"'!A2:A5"),"<"&DATE(YEAR(B3)+$B$1,MONTH(B3),DAY(B3)))
In the formula, update A2:A5 to match the actual range on the employee timesheets where vacation dates are recorded. Drag the formula down column C to apply it to all employees in your list.

Track Employee Leave Seamlessly with WPS Spreadsheet
WPS Spreadsheet offers full support for advanced functions like COUNTIFS, INDIRECT, and DATE, making it easy to build dynamic HR trackers and attendance summaries.
- 1. Open your attendance workbook: Launch WPS Spreadsheet and open the workbook containing your employee timesheets and summary list.
- 2. Apply the COUNTIFS formula: Navigate to the summary sheet, select the target cell, and paste the dynamic COUNTIFS and INDIRECT formula.
- 3. Calculate across sheets: Press Enter to execute the calculation, then drag the fill handle down to apply the formula for all employees listed.

Frequently Asked Questions
Why is my INDIRECT formula returning a #REF! error?
This usually happens if the employee name in your summary sheet does not perfectly match the tab name of their timesheet. Check for leading or trailing spaces in both names. It also occurs if the referenced external workbook is closed.
Can I count specific types of leave, like sick days vs. vacation days?
Yes. You can add another criteria pair to your COUNTIFS function. For example, add INDIRECT("'"&A3&"'!B2:B5") and "Vacation" to filter only the rows where column B specifies the leave type as vacation.
How do I account for leap years in the anniversary calculation?
The built-in DATE function automatically handles leap years correctly. If an employee was hired on February 29th, calculating their anniversary in a non-leap year will automatically default to March 1st.
Can I use this method if employee timesheets are in separate workbooks?
The INDIRECT function only works with external workbooks if those workbooks are currently open. If they are closed, INDIRECT will return an error. It is highly recommended to keep all employee sheets within the same workbook for this formula to function reliably.




