How to Calculate Fees from Numeric Ranges in Excel
Question details
The user needs to automatically calculate and return a fee based on an entered numeric amount using a lookup table, supporting both fixed fees and a final percentage-based fee.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Automating the calculation of tiered fees, commissions, or shipping costs based on numeric thresholds.
- Observed behavior
- Returns a specific fixed fee depending on the numeric range of the input amount, and dynamically applies a percentage calculation if the amount exceeds the highest threshold.
Ensure that your fee thresholds are organized in ascending order in your lookup table. This is required for the VLOOKUP function to correctly perform an approximate match for numeric ranges.
Use VLOOKUP for Fixed Fees Based on Ranges
Create a two-column lookup table and use the VLOOKUP function to quickly return the correct fixed fee for any given amount.
The VLOOKUP function is ideal for categorizing continuous numeric amounts into specific fee brackets. By setting the range lookup argument to TRUE (or omitting it), VLOOKUP performs an approximate match, finding the largest value that is less than or equal to your input amount.
Set up a two-column table (for example, in cells I2:J6). Enter your minimum threshold amounts in the first column and the corresponding fixed fees in the second column.
Click on the cell where you want the calculated fee to appear (e.g., cell B2 next to your input amount in A2).
Type the formula `=IF(A2="","",VLOOKUP(A2,$I$2:$J$6,2))` and press Enter. The IF function ensures that the cell remains blank if no amount has been entered yet.
Click the bottom-right corner of the cell containing your formula and drag the fill handle down to apply it to the rest of your data column.

Combine IF and VLOOKUP for a Final Percentage-Based Fee
Use this advanced method if the highest tier requires a percentage calculation instead of a flat fixed fee.
Easily Calculate Range-Based Fees with WPS Spreadsheet
WPS Spreadsheet provides full support for advanced lookup functions like VLOOKUP and IF, allowing you to seamlessly calculate tiered fees, commissions, and dynamic pricing without hassle.
- 1. Open your dataset: Launch WPS Spreadsheet and open your workbook containing the sales or fee amounts.
- 2. Create your reference table: Input your numeric thresholds and corresponding fee values into an empty section of your sheet.
- 3. Apply the lookup formula: Use the Formula tab or directly type `=VLOOKUP()` to automatically assign fees to your entire dataset in seconds.

Frequently Asked Questions
Why does my VLOOKUP formula return an #N/A error?
This usually happens if the lookup value (your input amount) is smaller than the lowest threshold in your lookup table. Ensure your input amount is greater than or equal to the very first value in your reference range.
Do my lookup table values need to be sorted?
Yes, when using VLOOKUP for range lookups (which uses an approximate match), the first column of your lookup table must be sorted in ascending order from smallest to largest. Otherwise, the formula will return incorrect fees.
How do I prevent the formula from showing 0 or #N/A when the cell is empty?
You can wrap your formula in an IF statement to check for blanks, such as `=IF(A2="","", VLOOKUP(A2,$I$2:$J$6,2))`. This instructs the software to return a blank string instead of triggering a calculation if no amount is entered.
Can I use XLOOKUP instead of VLOOKUP for calculating fees?
Yes, if your software supports it, you can use XLOOKUP with the match mode argument set to '-1' (exact match or next smaller item). This achieves the same tiered result but doesn't strictly require the threshold data to be sorted.




