Function Problems

How to Return a Value from the Same Row Using INDEX MATCH in Excel

Phi Hung VoPhi Hung Vo Nov 11, 2026 869 views

Question details

The user needs to locate a specific lookup value within a horizontal range on a single row and extract the corresponding paired value from an adjacent horizontal range on that exact same row.

How to Return a Value from the Same Row Using INDEX and MATCH in Excel
Product
Spreadsheet
Device & OS
not provided
Scenario
Extracting associated data from matching positions horizontally across columns, rather than searching vertically down columns.
Observed behavior
Standard vertical lookups (like VLOOKUP) retrieve data from different rows, but the user requires scanning horizontally across the current row to fetch matching paired values from a different horizontal section.
Before you start

Before applying these formulas, ensure that your lookup range and return range are located on the same row and contain the exact same number of columns to prevent #REF! or alignment errors.

Solution 1Recommended

Use INDEX and MATCH for Horizontal Same-Row Lookups

The most reliable and universally compatible method to perform horizontal lookups on a specific row across all spreadsheet versions.

The MATCH function locates the relative position (column number) of your lookup value, while the INDEX function uses that exact position number to fetch the corresponding value from your target range.

1
Select the destination cell

Click on the cell where you want the matched result to be displayed.

2
Enter the INDEX and MATCH formula

Type the formula: =INDEX(Return_Range, MATCH(Lookup_Value, Lookup_Range, 0)). For example, if your lookup value is in N23, your search range is AM23:AW23, and your return range is AN23:AX23, type: =INDEX(AN23:AX23, MATCH(N23, AM23:AW23, 0)).

3
Calculate the result

Press Enter. The formula will scan across AM23:AW23, find the match, and pull the paired value from the exact corresponding column in AN23:AX23.

Use INDEX and MATCH for Horizontal Same-Row Lookups
Handling Missing Data: Wrap your formula in IFERROR or IFNA, such as =IFERROR(INDEX(AN23:AX23, MATCH(N23, AM23:AW23, 0)), "Not Found"), to handle scenarios where the lookup value does not exist.
Advanced Spreadsheet Features

Perform Complex Lookups Effortlessly with WPS Spreadsheet

WPS Office Spreadsheet fully supports advanced lookup capabilities, including INDEX, MATCH, XMATCH, and XLOOKUP. You can easily retrieve paired data across rows and columns using a familiar interface that is highly compatible with Microsoft Excel formulas.

  1. 1. Open WPS Spreadsheet: Download, install, and launch WPS Office, then open your specific data workbook.
  2. 2. Access the Formulas Tab: Navigate to the 'Formulas' tab on the top ribbon and click on 'Insert Function'.
  3. 3. Utilize the Function Dialog: Search for 'INDEX' or 'MATCH' and use the intuitive input dialog boxes to select your same-row ranges without manually typing the complex syntax.
Seamlessly compatible with Microsoft Excel formulas, including complex nested lookups and array functions.Built-in function tooltips, auto-complete, and syntax guides to help you write INDEX and MATCH combinations easily.Lightweight, fast, and completely free to use for your daily data processing tasks.
microsoft office alternative - wps office

Frequently Asked Questions

Why is my INDEX MATCH formula returning an #N/A error?

An #N/A error occurs when the MATCH function cannot find the exact lookup value in your specified horizontal range. Double-check for trailing spaces in your cells, mismatched data types (such as numbers formatted as text), and ensure you included '0' at the end of the MATCH function for an exact match.

Do the horizontal ranges in INDEX and MATCH need to be the same size?

Yes. When performing a horizontal lookup, the return range in INDEX and the search range in MATCH must span the exact same number of columns. If one range is larger or shifted compared to the other, the formula may return incorrect paired values or result in a #REF! error.

Can I use XLOOKUP instead of INDEX and MATCH for same-row lookups?

Yes! If you are using a modern spreadsheet tool like WPS Spreadsheet or newer versions of Excel, you can use the XLOOKUP function. The syntax =XLOOKUP(N23, AM23:AW23, AN23:AX23) directly replaces the combined INDEX and MATCH formula, making it simpler and more efficient.