How to Calculate Bonus Days Based on Hours Worked in Excel
Question details
The user needs to calculate the number of bonus or holiday days an employee has earned based on their total hours worked, utilizing a defined range lookup table.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Automating HR or payroll calculations where specific intervals of hours worked qualify for a corresponding number of days off.
- Observed behavior
- The user needs a formula to look up a value within defined ranges and return the corresponding bonus days, avoiding the need to manually check each employee's hours against the interval criteria.
Ensure your data is organized into a clear lookup table, with the minimum hours required in one column and the corresponding bonus days in the adjacent column, sorted in ascending order.
Use XLOOKUP for Approximate Matching
XLOOKUP is the most modern and efficient way to perform approximate matches across defined ranges without needing complex array formulas.
XLOOKUP allows you to search for a value and return a corresponding result from another column. By setting the match mode to 1 or -1, it can easily evaluate numerical tiers and ranges.
Create a reference table where column A contains the hour thresholds (e.g., A3:A12) and column B contains the corresponding bonus days (B3:B12).
Click on the cell where you want the calculated bonus days for a specific employee to appear.
Type the formula =XLOOKUP(C3, A3:A12, B3:B12, , 1), replacing C3 with the cell containing the employee's actual hours worked.
Press Enter to get the result. The '1' match mode ensures that if an exact match isn't found, the formula returns the next larger item in your threshold list.

Use INDEX and MATCH for Older Versions
For versions of Excel older than 2021 that do not support XLOOKUP, use an INDEX and MATCH combination to achieve the same result.
Use WPS Spreadsheet to Calculate Bonus Days
WPS Spreadsheet fully supports modern functions like XLOOKUP, making it incredibly easy to calculate tiered bonuses, holidays, and payroll data without lag or compatibility issues.
- 1. Open your workbook: Launch WPS Spreadsheet and open the file containing your employee hours.
- 2. Create the lookup table: Set up your reference table with the hour thresholds and corresponding bonus days.
- 3. Enter the formula: Type =XLOOKUP() into your target cell, selecting your lookup value, lookup array, and return array.
- 4. Calculate instantly: Press Enter to instantly calculate the accrued time off and drag the formula down for all rows.

Frequently Asked Questions
What does the '1' mean at the end of the XLOOKUP formula?
The '1' specifies the match mode for XLOOKUP. It tells the function that if an exact match isn't found, it should return the next larger item in the lookup array. If your logic requires rounding down to the next smaller item, you should use '-1' instead.
Can I use VLOOKUP instead of XLOOKUP for this?
Yes, you can use VLOOKUP for tiered calculations by setting the final argument (range_lookup) to TRUE (or 1) for an approximate match. However, your lookup table must be sorted in ascending order for VLOOKUP to return accurate results.
Why does my XLOOKUP return an #N/A error?
This error usually occurs if the lookup value is not found and no 'if_not_found' parameter is specified. In the context of approximate matches, it can also happen if the search value falls outside the defined range and the match mode isn't correctly configured to handle it.
How do I enter an array formula in older spreadsheet versions?
Instead of just pressing Enter after typing your formula, you must press Ctrl + Shift + Enter simultaneously. The spreadsheet will automatically wrap the formula in curly braces {} to indicate it is being evaluated as an array formula.




