Function Problems

Excel INDEX and MATCH Lookup with Two Criteria

Huma Ashraf ChHuma Ashraf Ch Nov 13, 2026 869 views

Question details

Return a category from another sheet by matching both an organization and an object.

Look Up a Category in Excel with INDEX and MATCH Using Two Criteria
Product
Microsoft Excel
Device & OS
not provided
Scenario
A worksheet contains organization and object values, and a second worksheet contains the corresponding categories.
Observed behavior
The desired result is the category from the row where both lookup criteria match.
Before you start

Check which columns contain the organization, object, and category on the source sheet. Make sure the lookup and return ranges cover the same rows.

Solution 1Recommended

Use INDEX and MATCH to Find a Category by Two Criteria

Use this formula when the category is on another sheet and both the organization and object must match.

The formula compares each source row against both criteria and returns the category from the first row where both match.

1
Check the worksheet columns

In Sheet1, place the organization in B2 and the object in C2. In Sheet2, use column A for organizations, column B for objects, and column C for categories.

2
Enter the lookup formula

Select Sheet1 cell A2 and enter =INDEX('Sheet2'!$C$2:$C$300,MATCH(1,INDEX(('Sheet2'!$A$2:$A$300=B2)*('Sheet2'!$B$2:$B$300=C2),0),0)).

3
Adjust and fill the formula

Replace Sheet2 and the ranges with your actual sheet name and data rows, keeping all three ranges the same size. Drag the fill handle from A2 down to apply the formula to additional rows.

Use INDEX and MATCH to Find a Category by Two Criteria
No matching row: The formula returns #N/A if no row matches both criteria. Check the source values and ranges for differences or extra spaces.
WPS Spreadsheet

Look Up Categories by Two Criteria in WPS Spreadsheet

Open your workbook in WPS Spreadsheet and use INDEX and MATCH to return a category when both lookup values match.

  1. 1. Open the workbook: Open WPS Spreadsheet and use Open to select your Excel workbook.
  2. 2. Check the columns: Confirm that Sheet1 has the organization in B2 and object in C2, and that Sheet2 has organizations, objects, and categories in columns A, B, and C.
  3. 3. Enter the formula: Select Sheet1 cell A2 and enter =INDEX('Sheet2'!$C$2:$C$300,MATCH(1,INDEX(('Sheet2'!$A$2:$A$300=B2)*('Sheet2'!$B$2:$B$300=C2),0),0)). Adjust the sheet name and ranges to match your workbook.
  4. 4. Apply it to other rows: Drag the fill handle from A2 down to look up categories for the remaining rows, then use File > Save to save the workbook.
Match organization and object values in one formulaOpen and edit Microsoft Excel XLSX and XLS filesFill the lookup formula down for multiple rowsWork in a familiar spreadsheet interface
QA img-9

Frequently Asked Questions

What happens if more than one row matches both criteria?

MATCH returns the position of the first matching row, so INDEX returns that row's category.

Why does the formula return #N/A?

No row may match both criteria. Check Sheet1 cells B2 and C2 against the values in Sheet2 columns A and B, including any extra spaces, and verify that the ranges include the source row.

How do I use a different source sheet or larger range?

Replace each Sheet2 reference with the source sheet name and update all three ranges to cover the same rows. For example, change each ending row from 300 to 500.

Can I show a message instead of #N/A?

Wrap the formula in IFNA, for example: =IFNA(INDEX('Sheet2'!$C$2:$C$300,MATCH(1,INDEX(('Sheet2'!$A$2:$A$300=B2)*('Sheet2'!$B$2:$B$300=C2),0),0)),"Not found").