Function Problems

Replace More Than 64 Nested IF Functions with a Lookup Table in WPS Spreadsheets

Steven ParkerSteven Parker Nov 13, 2026 869 views

Question details

The user needs to simplify a long Excel formula that matches a text label and a numeric range without exceeding the Excel 2016 nested IF limit.

Replace More Than 64 Nested IF Functions with a Lookup Table in WPS Spreadsheets
Product
WPS Office Spreadsheets
Device & OS
not provided
Scenario
The user is working with a spreadsheet formula that returns a value based on both a text category and a numeric range, and wants a maintainable lookup table approach instead of deeply nested IF functions.
Observed behavior
The nested IF formula is long and difficult to manage, and Excel 2016 stops accepting formulas that exceed 64 nested IF levels.
Before you start

Open your workbook in WPS Spreadsheets and identify the two lookup criteria: the text label column and the numeric range column. Create a separate lookup table sheet with text labels in the first column, numeric thresholds in the header row, and the return values in the table body.

Solution 1Recommended

Replace the Nested IF Formula with an INDEX and MATCH Lookup Table

Use this method when the formula must return a value based on both a text label and a numeric range, and the nested IF formula is long, hard to update, or has hit the 64-level limit.

An INDEX and MATCH lookup table separates the decision logic from the formula. The text label is matched exactly against the first table column, and the numeric range is matched approximately against the header row. This avoids the nested IF limit and makes future changes easier.

Numeric headers must be sorted in ascending order for approximate matching to return the correct range column.

1
Create the lookup table sheet

In WPS Spreadsheets, click the plus icon near the sheet tabs to add a new sheet. Enter the text labels in column A starting at A2, enter the ascending numeric range thresholds in row 1 starting at B1, and fill the table body with the value to return for each label and range.

2
Enter the INDEX and MATCH formula

Select the result cell in your data sheet and type =INDEX(Lookup!$B$2:$N$100,MATCH($A2,Lookup!$A$2:$A$100,0),MATCH($B2,Lookup!$B$1:$N$1,1)). Adjust Lookup! and the ranges to your actual sheet name and table size.

3
Apply the formula to the remaining rows

Press Enter, then drag the fill handle down to copy the formula. The first MATCH returns the row for the exact text label, and the second MATCH returns the column for the largest threshold less than or equal to the numeric value.

4
Test the lookup boundaries

Change the numeric value to a value just below, exactly on, and above a threshold to confirm that the formula returns values from the expected column.

Replace the Nested IF Formula with an INDEX and MATCH Lookup Table
Nested IF limit avoided: The formula no longer contains nested IF levels and continues to work when the lookup table is expanded.
WPS Spreadsheets

Replace Long Nested IF Formulas with a WPS Spreadsheets Lookup Table

Perform the same lookup-table replacement directly in WPS Spreadsheets. Open your Excel file, create the lookup table, and use INDEX and MATCH exactly as you would in Excel without hitting the nested IF limit.

  1. 1. Open your workbook: Install WPS Office, open WPS Spreadsheets, and then open the Excel workbook that contains the nested IF formula.
  2. 2. Prepare the lookup table: Add a new sheet, place text labels in the first column, ascending numeric thresholds in the header row, and return values inside the table.
  3. 3. Replace the formula: In the result cell, enter =INDEX(Lookup!$B$2:$N$100,MATCH($A2,Lookup!$A$2:$A$100,0),MATCH($B2,Lookup!$B$1:$N$1,1)) and adjust it to your actual sheet name and ranges.
  4. 4. Save as an Excel-compatible file: Press Enter, copy the formula down, then click Menu, select Save As, and choose .xlsx to keep the workbook compatible with Microsoft Excel.
Avoid Excel's 64-level nested IF restriction with a formula that stays short and readable.Full compatibility with Microsoft Excel .xlsx files for opening, editing, and saving.Supports familiar Excel formulas such as INDEX, MATCH, and VLOOKUP.Free, lightweight, and easy to use with an Excel-like ribbon.
microsoft office alternative - wps office

Frequently Asked Questions

Why does Excel stop accepting more than 64 nested IF functions?

Excel 2016 has a formula nesting limit of 64 levels. When a formula exceeds that limit or becomes too long to maintain, a lookup table with INDEX and MATCH is the recommended replacement.

How do I make approximate matching work for numeric ranges in INDEX and MATCH?

Use MATCH(lookup_value, header_row, 1) for the column lookup. It finds the largest value that is less than or equal to the lookup value, so the numeric header row must be sorted in ascending order.

Can I use this lookup table method in WPS Spreadsheets?

Yes. Open WPS Spreadsheets, select the result cell, and enter the INDEX and MATCH formula directly. The function names, arguments, and behavior are the same as in Excel.

What if both lookup criteria are exact text values instead of numeric ranges?

Change the column MATCH match type from 1 to 0. For example, use MATCH($C$1,Lookup!$B$1:$N$1,0) to find an exact text header instead of an approximate numeric range.

Do I still need nested IF formulas if my thresholds change frequently?

No. Update the threshold values or return values in the lookup table, and the INDEX and MATCH formulas automatically use the new values without rewriting the formula.