Use Multiple Criteria to Look Up Estimated Cost in Excel
Question details
Find an estimated cost based on length, subtype, and condition without using a long series of nested IF statements.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet contains estimated costs associated with combinations of length, subtype, and condition.
- Observed behavior
- The desired result is a cost from a row that matches all three criteria.
Arrange the lookup data in columns with one row per combination. For the examples below, use columns A–D for length, subtype, condition, and cost, and enter the lookup criteria in F2, G2, and H2.
Find the First Matching Cost with INDEX and MATCH
Use this approach when you need one cost and want a formula that works across a range of Excel versions.
Place the data in A2:D100, with length in A, subtype in B, condition in C, and estimated cost in D. Adjust all four ranges to cover the same rows if your table is a different size.
Type the length in F2, the subtype in G2, and the condition in H2. Make sure the values match the data types and spelling used in columns A–C.
Select an empty result cell and enter =INDEX(D2:D100,MATCH(1,INDEX((A2:A100=F2)*(B2:B100=G2)*(C2:C100=H2),0),0)). Press Enter. If your Excel version requires array entry, select the formula cell, press F2, and then press Ctrl+Shift+Enter.

Return All Matching Costs with FILTER
Use FILTER in a supported version of Excel when more than one row may match and you want to see every matching cost.
Look Up Estimated Costs with WPS Spreadsheet
Use INDEX and MATCH in WPS Spreadsheet to find the first cost matching a length, subtype, and condition.
- 1. Open the worksheet: Open WPS Spreadsheet and select Open to load your Excel workbook.
- 2. Arrange the data: Place length, subtype, condition, and cost in columns A–D, and enter the three lookup values in F2, G2, and H2.
- 3. Enter the formula: Select an empty cell and enter =INDEX(D2:D100,MATCH(1,INDEX((A2:A100=F2)*(B2:B100=G2)*(C2:C100=H2),0),0)). Press Enter.
- 4. Check the result: Compare the returned cost with the first matching row. If you see #N/A, check the criteria in F2:H2 and the data in A2:C100.

Frequently Asked Questions
Why does the INDEX and MATCH formula return #N/A?
No row may match all three criteria. Check F2, G2, and H2 against columns A–C for spelling, extra spaces, and numbers stored as text. Also make sure the ranges cover the relevant rows.
What happens if multiple rows match the criteria?
The INDEX and MATCH formula returns the cost from the first matching row. Use the FILTER formula to return all matching costs in a supported version of Excel.
Can I use an Excel table instead of fixed cell ranges?
Yes. Select your data and choose Insert > Table, then replace the cell ranges in the formula with the corresponding structured column references. Each referenced column should cover the same table rows.
Why does FILTER show a #SPILL! error?
FILTER needs empty cells below the formula for multiple results. Clear any values or merged cells blocking the spill area and check the formula again.




