Look Up a Value by Row and Column
Return a value from the intersection of editable row and column labels by supplying INDEX with two exact MATCH positions and validating both headers for uniqueness.
| Two-Way Lookup with INDEX and MATCH, Formula Review | ||||||||||
| Find row and column positions separately, then return their matrix intersection. | ||||||||||
| Forecast revenue matrix ($m) | Criteria and function review | |||||||||
| Scenario | 2025 | 2026 | 2027 | 2028 | Scenario criterion | Base | ||||
| Downside | $90.0 | $95.0 | $101.0 | $108.0 | Year criterion | 2,027 | ||||
| Base | $100.0 | $112.0 | $126.0 | $141.0 | Second intersection | Upside | 2,028 | |||
| Upside | $110.0 | $125.0 | $144.0 | $166.0 | ||||||
| Stretch | $118.0 | $138.0 | $162.0 | $190.0 | Step | Formula syntax | Result | |||
| Row MATCH | =MATCH($J$11,$A$12:$A$15,0) | 2 | ||||||||
| Column MATCH | =MATCH($J$12,$B$11:$E$11,0) | 3 | ||||||||
| Combined INDEX | =INDEX($B$12:$E$15,MATCH($J$11,$A$12:$A$15,0),MATCH($J$12,$B$11:$E$11,0)) | $126.0 | ||||||||
| Second intersection | =INDEX($B$12:$E$15,MATCH($J$13,$A$12:$A$15,0),MATCH($K$13,$B$11:$E$11,0)) | $166.0 | ||||||||
| Reliability checks | ||||||||||
| Selected scenario occurs exactly once in the row headers | OK | |||||||||
| Selected year occurs exactly once in the column headers | OK | |||||||||
| Combined lookup ties to INDEX driven by the visible MATCH positions | OK | |||||||||
Overview
Return one value from the intersection of a selected matrix row and column. MATCH locates the positions of the scenario and year; INDEX uses those positions to retrieve the corresponding forecast revenue.
When to use it
Use it for scenario-year forecasts, sensitivity tables, pricing grids, term-by-rating matrices, or other layouts where both labeled axes define the result. It works in longstanding Excel versions and keeps the row and column positions independently visible.
When not to use it
Use a multiple-criteria lookup when the source is normalized into records instead of a matrix. Nested XLOOKUP may be clearer in modern Excel. Approximate MATCH belongs only to deliberately sorted numeric bands, not discrete scenario or year headers.
Problem
A one-way lookup can locate either a scenario row or a year column but cannot identify their intersection alone. Hardcoded position numbers break if axes are reordered. Both coordinates must be derived from exact labels and aligned with a values-only matrix.
Inputs
Input | Location | Sample |
|---|---|---|
Scenario | | Base |
Year | | 2027 |
Source data
The synthetic revenue matrix in A11:E15 is measured in millions:
Scenario | 2025 | 2026 | 2027 | 2028 |
|---|---|---|---|---|
Downside | 90 | 95 | 101 | 108 |
Base | 100 | 112 | 126 | 141 |
Upside | 110 | 125 | 144 | 166 |
Stretch | 118 | 138 | 162 | 190 |
Row and column headers must be unique. Numeric years must not be mixed with identical-looking text values.
Calculations
- Match the scenario exactly against the row headers.
- Match the year exactly against the column headers.
- Interpret the returned positions relative to their header ranges.
- Pass the row and column numbers to INDEX.
- Validate header uniqueness and reconcile to the visible positions.
Outputs
Base is row position 2 and 2027 is column position 3. INDEX returns 126.0, representing $126.0 million. Positions are relative to the matrix, not worksheet row and column numbers.
Formula map
=INDEX($B$12:$E$15,MATCH($J$11,$A$12:$A$15,0),MATCH($J$12,$B$11:$E$11,0))
The INDEX array contains values only. The first MATCH supplies row_num, the second supplies column_num, and 0 requires exact matching. All ranges are fixed because the formula returns one selected value.
Model checks
The workbook confirms that the selected scenario and year each occur exactly once and that INDEX using the displayed row and column positions equals the combined formula. All three checks return OK.
Edge cases
- A missing row or column label returns
#N/Afrom MATCH. - Duplicate headers make the intersection ambiguous because MATCH returns the first occurrence.
- Numeric and text versions of the same year may not match.
- The matrix dimensions must correspond exactly to the two header ranges.
- Reordering headers and their data together is safe because positions are recalculated.
Common errors
- Including headers in INDEX: positions point to the wrong cells. Select only the data matrix.
- Reversing MATCH results: row and column coordinates are swapped. Pass scenario first, year second.
- Omitting exact mode: discrete labels may match incorrectly. Use
0. - Hardcoding positions: reordering breaks the result. Derive both positions from labels.
Example
Base is the second row of the values matrix and 2027 is its third column. INDEX(matrix,2,3) therefore returns 126.0. As a second workbook test, Upside and 2028 resolve to row 3, column 4, and 166.0.
Example workbook
Edit the cream selections in Combined Example!J11:J12. Visible positions in J14:J15, revenue in J16, and three checks update automatically. Formula Review separates the row MATCH, column MATCH, and combined INDEX calculation.
Key takeaway
Match each axis exactly, validate unique headers, and keep the INDEX array limited to values so the two derived positions identify one unambiguous intersection.