Function Problems

Excel Two-Way Lookup: Return a Value by Row and Column Criteria

Algirdas JasaitisAlgirdas Jasaitis Dec 2, 2026 868 views

Question details

Return the value at the intersection of a matching row label and column header in a two-dimensional table.

Return an Excel Table Value Using Row and Column Criteria
Product
Microsoft Excel
Device & OS
not provided
Scenario
A worksheet contains row labels, column headers, and a table of values. Two criteria identify the cell to return.
Observed behavior
The desired result is the value in the cell where the matching row and column intersect.
Before you start

Identify the cells containing the row criterion and column criterion, along with the row-label range, header range, and data range. In the examples below, the criteria are in B2 and C2, row labels are in F2:F4, headers are in G1:H1, and values are in G2:H4.

Solution 1Recommended

Use INDEX and MATCH for an exact two-way lookup

Use this method to return a numeric or text value from the intersection of a matching row and column.

1
Enter the criteria

Enter the row label to find in B2 and the column header to find in C2.

2
Enter the lookup formula

Select the cell where you want the result and enter =INDEX($G$2:$H$4,MATCH(B2,$F$2:$F$4,0),MATCH(C2,$G$1:$H$1,0)).

3
Check the result

Press Enter. If your table is elsewhere, edit the formula so the row-label and header ranges align with the rows and columns of the data range.

Use INDEX and MATCH for an exact two-way lookup
Exact matches: The 0 in each MATCH function requires an exact match. If either criterion is not found, the formula returns #N/A. If labels or headers are duplicated, MATCH uses the first match.
Two-way lookup in WPS Spreadsheets

Find a Table Intersection in WPS Spreadsheets

Use INDEX and MATCH in WPS Spreadsheets to return a value from a table based on a row label and a column header.

  1. 1. Open the workbook: Open WPS Spreadsheets and use Open to select your workbook.
  2. 2. Enter the lookup criteria: Enter the row label in B2 and the column header in C2, or identify the cells that already contain them.
  3. 3. Enter the formula: Select an empty result cell and enter =INDEX($G$2:$H$4,MATCH(B2,$F$2:$F$4,0),MATCH(C2,$G$1:$H$1,0)), adjusting the ranges to match your table.
  4. 4. Return the result: Press Enter to display the value at the matching row and column intersection.
Match row and column criteria with familiar spreadsheet functionsReturn either text or numeric values with INDEX and MATCHWork with Microsoft Excel XLSX and XLS files
microsoft office alternative - wps office

Frequently Asked Questions

Can INDEX and MATCH return text as well as numbers?

Yes. INDEX returns the contents of the matching cell whether it contains text or a number.

Why does the formula return #N/A?

One of the MATCH functions could not find an exact match. Check the criteria in B2 and C2 against the row labels and column headers, including any extra spaces.

What happens if a row label or column header appears more than once?

MATCH returns the position of the first matching label or header. Use unique labels and headers if you need to identify one specific cell.

Can SUMPRODUCT return a text value from the table?

No. The SUMPRODUCT formula shown is intended for numeric values. Use INDEX and MATCH when the matching cell may contain text.