Function Problems

Replace Nested IF Formulas with a Multi-Criteria Lookup in Excel

Bushra ParveenBushra Parveen Nov 20, 2026 869 views

Question details

Find a maintainable alternative to nested IF or IFS formulas for calculating costs from multiple criteria.

Replace Nested IF Formulas with a Multi-Criteria Lookup in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
A maintenance cost depends on the selected plan, period, and size, with many possible combinations.
Observed behavior
The desired formula returns the cost for the selected combination and can be updated by editing a lookup table.
Before you start

List each plan, period, size, and cost combination in a table, with one combination per row. Make sure the selected values use the same spelling and period format as the table.

Solution 1Recommended

Use INDEX and MATCH with a combined lookup key

Use a helper column to find the cost for a plan, period, and size without maintaining a long conditional formula.

This example assumes an 89-row lookup table in A2:D90. The helper key combines the three criteria, and MATCH locates the corresponding row.

The 64-level limit applies to nested IF levels, not to the number of rows in a lookup table.

1
Create the lookup table

Enter Plan, Period, Size, and Cost in A1:D1, then enter one combination per row in A2:D90. For example, enter Yellow, 4 weeks, Big, and 908 in one row.

2
Build the helper key

Enter Key in E1. In E2, enter =A2&"|"&B2&"|"&C2, then fill the formula down through E90.

3
Enter the selected criteria

Enter the desired plan in H2, period in H3, and size in H4. For example, use Yellow, 4 weeks, and Big.

4
Look up the cost

In H5, enter =IFERROR(INDEX($D$2:$D$90,MATCH(H2&"|"&H3&"|"&H4,$E$2:$E$90,0)),"No match"). The example returns 908. Adjust the ranges if your table has a different number of rows.

Use INDEX and MATCH with a combined lookup key
Check for duplicate combinations: MATCH returns the first matching row, so keep each plan, period, and size combination unique. Avoid using the | character inside the criteria values.
Calculate costs with a lookup table

Build the same multi-criteria cost lookup in WPS Spreadsheet

Use a helper key and INDEX/MATCH in WPS Spreadsheet to return a cost from a table instead of maintaining a long nested IF formula.

  1. 1. Set up the table: Open WPS Spreadsheet and enter Plan, Period, Size, and Cost in columns A through D, with one combination per row.
  2. 2. Create a key: In E2, enter =A2&"|"&B2&"|"&C2 and fill it down beside the lookup rows.
  3. 3. Enter the selections: Enter a plan in H2, a period in H3, and a size in H4, matching the values in the table.
  4. 4. Return the cost: In H5, enter =IFERROR(INDEX($D$2:$D$90,MATCH(H2&"|"&H3&"|"&H4,$E$2:$E$90,0)),"No match"). Adjust the row ranges to fit your table.
Look up costs by plan, period, and sizeUpdate prices directly in the lookup tableOpen and save Microsoft Excel XLSX filesWork in a familiar spreadsheet interface
microsoft office alternative - wps office

Frequently Asked Questions

Why does the formula return “No match”?

Check that H2:H4 match the plan, period, and size values in the table, including spelling and period format. Also check that the helper formula is filled down to the relevant row and that the lookup ranges include it.

Can I add more cost combinations later?

Yes. Add each new combination below the table, fill the key formula down, and extend both ranges in the H5 formula to include the new rows.

What happens if the same combination appears twice?

MATCH finds the first matching key, so the formula returns the cost from the first matching row. Remove duplicates or decide which cost should apply.

Can XLOOKUP replace INDEX and MATCH?

Yes. In an Excel version that supports XLOOKUP, use the helper key with =XLOOKUP(H2&"|"&H3&"|"&H4,$E$2:$E$90,$D$2:$D$90,"No match").