Function Problems

Use One Excel Cell to Return Matching Values From Another Row

Camila MilosovichCamila Milosovich Nov 12, 2026 869 views

Question details

Use a value selected in one Excel cell to return the corresponding value from another row or range.

Use One Excel Cell to Return Matching Values From Another Row
Product
Microsoft Excel
Device & OS
not provided
Scenario
A worksheet contains related values in separate rows or columns, and the user wants a formula that displays the matching result after selecting or entering a lookup value.
Observed behavior
The required formula depends on whether the selected value identifies a column, a row, or an intersection of both.
Before you start

Identify the cell that contains the selected lookup value and the exact row or column that contains the result to return. Ensure lookup labels are consistent, with no unintended spaces or duplicate labels unless duplicates are expected.

Solution 1Recommended

Use XLOOKUP to return a value from a matching Excel column

Use this method when the selected value appears in a header row or lookup range and you need the related value from another row.

XLOOKUP finds the selected value in one range and returns the value from the same position in a second range. For example, if B1 contains a selected month and row 2 contains month names, the formula can return the matching sales value from row 3.

1
Select the result cell

Click the cell where you want the related value to appear, such as B5.

2
Enter an XLOOKUP formula

Type a formula such as =XLOOKUP(B1,$B$2:$M$2,$B$3:$M$3,"Not found"). Replace B1 with the selected-value cell, B2:M2 with the lookup row, and B3:M3 with the row that contains the values to return.

3
Press Enter and test the selection

Press Enter, then change the value in B1 or choose a different item from its drop-down list. The result cell updates with the matching value from the return row.

Use XLOOKUP to return a value from a matching Excel column
Use matching range sizes: The lookup range and return range must contain the same number of cells. If your Excel version does not support XLOOKUP, use INDEX and MATCH instead.
Formula lookup in WPS Spreadsheets

Return Related Row Values With Lookup Formulas in WPS Spreadsheets

WPS Spreadsheets lets you use XLOOKUP, INDEX, and MATCH to return a related value when a user selects an item in another cell. Build a simple lookup table, reference the selection cell, and use a formula to update the result automatically.

  1. 1. Open the worksheet in WPS Spreadsheets: Open your .xlsx or .xls file in WPS Office and select the sheet containing the lookup table.
  2. 2. Set up the selection cell: Click the input cell, then choose Data > Data Validation to create a list if users need to select from predefined lookup labels.
  3. 3. Add the lookup formula: Click the result cell and enter =XLOOKUP(B1,B2:M2,B3:M3,"Not found") or an INDEX and MATCH formula that matches your table layout.
  4. 4. Test each selected value: Change the value in the selection cell and confirm that the formula returns the corresponding value from the related row.
Use XLOOKUP or INDEX and MATCH to return values from matching rows or columns.Create drop-down selections with Data Validation for controlled lookup values.Open and edit Microsoft Excel .xlsx and .xls files with compatible spreadsheet formulas.Use a familiar spreadsheet interface for quick formula migration from Excel.
microsoft office alternative - wps office

Frequently Asked Questions

How do I return a value from another row based on a selected cell in Excel?

Use XLOOKUP when the selected value is in a matching header or lookup range. For example, =XLOOKUP(B1,B2:M2,B3:M3) finds B1 in B2:M2 and returns the value from the same position in B3:M3.

What formula should I use if my Excel version does not include XLOOKUP?

Use INDEX and MATCH: =INDEX(B3:M3,MATCH(B1,B2:M2,0)). MATCH locates the selected value, and INDEX returns the related value from the return row.

Can one selected value return a result from a table with row and column headings?

Yes. Use a two-way INDEX and MATCH formula, such as =INDEX(B2:M10,MATCH(B1,A2:A10,0),MATCH(C1,B1:M1,0)), where B1 selects the row and C1 selects the column.

Why does my lookup formula return #N/A?

The selected value is not an exact match in the lookup range, or it contains extra spaces or different text formatting. Check the lookup cell and labels, and use the exact-match argument 0 in MATCH.