Excel Two-Way Lookup: Return a Value by Row and Column Criteria
Question details
Return the value at the intersection of a matching row label and column header in a two-dimensional table.

- 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.
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.
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.
Enter the row label to find in B2 and the column header to find in C2.
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)).
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 SUMPRODUCT to return a matching numeric value
Use SUMPRODUCT when the table contains numbers and the criteria identify exactly one cell.
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. Open the workbook: Open WPS Spreadsheets and use Open to select your workbook.
- 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. 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. Return the result: Press Enter to display the value at the matching row and column intersection.

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.




