Function Problems

Calculate Annual Leave Balances with Different Weekday and Weekend Hours in Excel

Muhammad TalhaMuhammad Talha Nov 2, 2026 868 views

Question details

The user needs a way to calculate annual leave balances where absence deductions differ depending on the day of the week (e.g., deducting 8.81 hours for weekends and 9.26 hours for weekdays).

How to Calculate Annual Leave Balances with Different Weekday and Weekend Hours in Excel
Product
Excel
Device & OS
not provided
Scenario
Tracking employee attendance and leave balances using a spreadsheet with specific daily hour requirements.
Observed behavior
The user requires a formula that can differentiate between weekdays and weekends (Saturdays and Sundays) based on a header row and apply the corresponding hourly deductions automatically.
Before you start

Ensure your attendance sheet contains a row with the days of the week (or abbreviations like 'Sat' and 'Sun' starting with 'S') and a specific absence code (like 'A') used for logging time off.

Solution 1Recommended

Use COUNTIFS to Deduct Different Leave Hours Based on Day Type

This method utilizes the COUNTIFS function with wildcard criteria to count absence codes separately for days starting with 'S' (weekends) and all other days (weekdays), multiplying them by their respective hourly values.

By employing wildcards in the COUNTIFS function, you can create a single formula that dynamically identifies weekends versus weekdays based on your header row, eliminating the need to manually separate the columns.

1
Identify your data ranges

Locate the cell containing the total annual entitlement (e.g., AI7), the row containing the daily absence codes (e.g., C7:AG7), and the header row containing the days of the week (e.g., C5:AG5).

2
Select the target cell

Click on the cell where you want the remaining annual leave balance to be displayed.

3
Enter the COUNTIFS formula

Type the formula: =AI7-COUNTIFS(C7:AG7,"A",C5:AG5,"S*")*8.81-COUNTIFS(C7:AG7,"A",C5:AG5,"<>S*")*9.26

4
Apply the calculation

Press Enter on your keyboard to calculate the balance for the first row.

5
Fill the formula down

Click and drag the small square at the bottom-right corner of the cell (the fill handle) downwards to apply this calculation to the rest of the employees in your sheet.

Use COUNTIFS to Deduct Different Leave Hours Based on Day Type
How the Wildcards Work: The "S*" criteria targets any header text starting with 'S' (capturing both Saturday and Sunday). The "<>S*" criteria effectively excludes them, targeting the weekdays.
Advanced Spreadsheet Solutions

Efficiently Manage Attendance Tracking with WPS Spreadsheet

WPS Spreadsheet is fully equipped to handle advanced data tracking formulas like COUNTIFS, making HR calculations and leave balance management highly accurate and effortless.

  1. 1. Open your tracker: Launch WPS Spreadsheet and open your attendance tracking workbook.
  2. 2. Input the formula: Select the balance cell and input the COUNTIFS formula tailored to your weekend and weekday criteria.
  3. 3. Process the data: Press Enter and drag the fill handle down to calculate balances for the entire roster instantly.
Fully compatible with Microsoft Excel formulas, functions, and file formatsFree and lightweight alternative for robust spreadsheet managementUser-friendly interface ideal for setting up complex attendance trackersBuilt-in data validation and formatting tools to minimize entry errors
microsoft office alternative - wps office

Frequently Asked Questions

Can I use this formula if my weekend days are not Saturday and Sunday?

Yes. If your weekends fall on different days (for example, Friday and Saturday), you will need to adjust the criteria from "S*" to match exactly what is written in your header row for those specific days, potentially using multiple COUNTIFS additions.

How do I account for half-day absences in the same formula?

You can assign a different code (e.g., "H") for half-days and subtract an additional COUNTIFS segment from your total. For example: -COUNTIFS(C7:AG7,"H",C5:AG5,"<>S*")*4.63.

Why is the formula returning an error or incorrect calculation?

Ensure that the ranges for the header row (e.g., C5:AG5) and the absence tracking row (e.g., C7:AG7) are exactly the same size. Unequal range sizes in a COUNTIFS function will result in an error.