How to Calculate Leave Days Between Dates in Excel Using Formulas
Question details
The user needs to calculate the total number of leave days between specific start and end dates while filtering records by a specific remark, such as 'Leave' or 'L'.
- Product
- Excel
- Device & OS
- not provided
- Scenario
- Tracking employee attendance or calculating absence durations from a dataset containing dates and corresponding status remarks.
- Observed behavior
- Requires an accurate formula to count the number of days falling within a specific date range that also matches a designated text criteria.
Ensure that your start and end dates are formatted as valid date values in Excel, and verify the exact text used in your status remarks column (e.g., 'Leave' or 'L') to ensure the formula matches it properly.
Use the COUNTIFS Function to Calculate Leave Days
COUNTIFS is the most efficient way to count rows that meet multiple criteria, such as falling within a specified date range and having a specific status remark.
The COUNTIFS function applies criteria to cells across multiple ranges and counts the number of times all criteria are met. This is ideal for verifying if a date is greater than or equal to a start date, less than or equal to an end date, and marked as 'Leave'.
Determine which column holds the dates (e.g., Column A), the column for remarks (e.g., Column B), and the cells containing your specific start date (e.g., D2) and end date (e.g., D3).
Select an empty cell where you want the result to appear and type the formula: =COUNTIFS(A:A, ">="&D2, A:A, "<="&D3, B:B, "L").
Change the 'L' remark in the formula to match the exact text you use for leaves in your spreadsheet, such as 'Leave' or 'Absent'. Update the column references if your data is located elsewhere, then press Enter to get the total calculated leave days.
Calculate Leave Days Effortlessly in WPS Office
WPS Spreadsheet fully supports advanced functions like COUNTIFS, making it easy to track employee attendance, calculate leave days, and manage large datasets with seamless compatibility and a familiar interface.
- 1. Open your attendance sheet: Launch WPS Spreadsheet and open your existing attendance tracking or timesheet workbook.
- 2. Input the COUNTIFS formula: Select the target cell and type your COUNTIFS formula to filter the specific dates and leave remarks.
- 3. Calculate instantly: Hit Enter to view the calculated leave days based on your designated start date, end date, and criteria.

Frequently Asked Questions
Can I use NETWORKDAYS to calculate leave days instead of COUNTIFS?
Yes, if you want to calculate the total number of working days between a start and end date (automatically excluding weekends), you can use the NETWORKDAYS function. However, NETWORKDAYS cannot natively filter records based on a specific text remark in another column like COUNTIFS does.
Why is my COUNTIFS formula returning zero?
This usually happens if your dates are formatted as text instead of recognized numerical dates, or if the remark text in the formula does not exactly match the text in your column (such as hidden trailing spaces). Check your date cell formatting and ensure your criteria match exactly.
How do I calculate leave days for a specific employee only?
You can add another set of criteria to your COUNTIFS formula to filter by name. For example: =COUNTIFS(A:A, ">="&D2, A:A, "<="&D3, B:B, "L", C:C, "John Doe"), assuming Column C contains the employee names.




