How to Return a Value from the Same Row Using INDEX MATCH in Excel
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.

- 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 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.
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.
Click on the cell where you want the matched result to be displayed.
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)).
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 XMATCH in Modern Spreadsheet Versions
A modernized, shorter approach using XMATCH, which defaults to exact matches and streamlines your formula writing.
Use VLOOKUP with INDIRECT for Dynamic Row Adaptation
An alternative method useful if you are combining vertical and horizontal concepts, though generally less efficient than INDEX/MATCH.
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. Open WPS Spreadsheet: Download, install, and launch WPS Office, then open your specific data workbook.
- 2. Access the Formulas Tab: Navigate to the 'Formulas' tab on the top ribbon and click on 'Insert Function'.
- 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.

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.




