Use a Lookup Table Instead of Multiple IFS Conditions in Excel
Question details
The user wants to map student scores to grades without writing a complicated, nested IFS formula for every possible score threshold.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Calculating student grades from a score table based on numeric thresholds.
- Observed behavior
- The user needs an efficient alternative to lengthy and hard-to-maintain nested IF or IFS statements.
Ensure your grading thresholds are organized in ascending order within a dedicated reference table before applying any lookup formulas.
Use INDEX and MATCH for Flexible Table Lookups
This approach replaces long IFS functions by looking up values in a structured table, making your formula easier to read and maintain.
Whenever there is a temptation to use many levels of IF statements, a table lookup is often more suitable. Using the INDEX and MATCH combination provides a powerful way to retrieve grades based on scores without the limitations of nested formulas.
Set up a table named 'Table1' with two columns: 'Score' (for the threshold values) and 'Grade' (for the corresponding letter grades).
Click on the cell where you want the calculated student grade to appear.
Type the formula: =IFERROR(IF(ISBLANK(G2),"Enter Score Above",INDEX(Table1[Grade],MATCH(G2,Table1[Score],0))),"Score Out Of Range"). Replace 'G2' with the cell reference containing the student's score.
Press Enter to execute the function. The formula checks for blanks, looks up the corresponding grade, and handles out-of-range errors automatically.

Use VLOOKUP with Approximate Match
VLOOKUP is a simpler alternative to INDEX/MATCH when your threshold table is sorted in ascending order.
Simplify Complex Formulas with WPS Spreadsheet
WPS Spreadsheet fully supports advanced lookup functions like INDEX, MATCH, VLOOKUP, and XLOOKUP. You can easily manage grade thresholds and avoid long nested IFS statements while enjoying full compatibility with Microsoft Excel formats.
- 1. Open WPS Spreadsheet: Launch WPS Spreadsheet and create or open your scoring threshold table.
- 2. Select your output cell: Click on the cell where you want to output the calculated grade.
- 3. Insert the lookup function: Go to the Formulas tab on the top ribbon, click 'Insert Function', and search for INDEX or VLOOKUP.
- 4. Apply parameters: Input your lookup value, highlight your reference table array, and press OK to apply the formula efficiently.

Frequently Asked Questions
Why is a lookup table better than a nested IF or IFS formula?
Lookup tables are much easier to read, update, and maintain. If your grading scale changes, you only need to update the table values instead of rewriting complex, error-prone formulas across your entire spreadsheet.
Does the lookup table need to be sorted?
If you are using VLOOKUP or MATCH with an approximate match (match_type 1 or TRUE), the lookup column must be sorted in ascending order. If you use an exact match (match_type 0), sorting is not strictly required.
Can I use Data Validation with my lookup table?
Yes, you can use Data Validation to restrict the input scores to a specific minimum and maximum range (e.g., 0 to 100). This ensures your lookup formula doesn't return unexpected results due to invalid data entry.
What happens if a score is outside the table's range?
By wrapping your lookup formula in an IFERROR function, you can catch calculation errors and display a custom message like 'Score Out Of Range' instead of the default Excel #N/A error.




