How to Use Excel Formulas to Return a Matching Row of Data
Question details
The user needs to retrieve and return multiple related values across a row based on a specific lookup reference value in an Excel table.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Looking up data dynamically across rows to auto-populate reports, invoices, or master dashboards.
- Observed behavior
- The goal is to automatically fill cells in a horizontal row with data corresponding to a matched lookup value from a source table.
Ensure your source data has a unique column for the lookup value to prevent incorrect or duplicate matches, and check that both data ranges are formatted similarly.
Use INDEX and MATCH Formulas (Compatible with All Excel Versions)
The combination of INDEX and MATCH is a robust, universally compatible way to look up a value and return an entire row of data, working perfectly in older versions like Excel 2019.
By nesting a MATCH function inside an INDEX function, you can search for a specific value in a column and return the corresponding value from another column. Locking the column reference ensures you can drag the formula horizontally across the row.
Click on the cell where you want the first returned value to appear (for example, B5).
Type the formula: =IFERROR(INDEX(B$8:B$9999,MATCH($C5,$C$8:$C$9999,0)),"") where $C5 is your lookup value and $C$8:$C$9999 is the lookup column.
Press Enter. Select the cell, click the small square in the bottom-right corner (fill handle), and drag it across the row to populate the remaining columns.

Reference Data on Another Worksheet
If your master table is on a different tab, you must include the sheet name in your formula to direct Excel to the correct data range.
Use the XLOOKUP Function (Excel 365 and 2021)
XLOOKUP is a newer, simpler formula that can easily 'spill' an entire row of matching data without the need to drag the formula across columns.
Use WPS Spreadsheet to Easily Look Up and Return Row Data
WPS Office offers a powerful Spreadsheet application that fully supports advanced lookup functions like XLOOKUP, INDEX, and MATCH. You can manage complex datasets and cross-sheet references smoothly without paying for expensive software.
- 1. Open Your Workbook: Launch WPS Spreadsheet and open the file containing your lookup table and destination table.
- 2. Select the Target Cell: Click on the cell where you want to output the lookup result.
- 3. Input the Formula: Go to the Formulas tab or type your =XLOOKUP or =INDEX(MATCH()) formula directly into the formula bar.
- 4. Drag to Fill: Press Enter, then use the fill handle in the corner of the cell to copy the formula across the row if you are using INDEX and MATCH.

Frequently Asked Questions
Why does my INDEX MATCH formula return #N/A?
This error occurs when the exact lookup value cannot be found in the reference array. Ensure there are no leading or trailing spaces, check that numbers aren't stored as text, and confirm the lookup array covers the correct range.
Can I look up multiple criteria at once?
Yes, you can use an array formula with INDEX and MATCH by concatenating lookup values and arrays using the ampersand (&) symbol. Similarly, XLOOKUP allows multiple criteria by linking them in the lookup arguments.
How do I return a row of data horizontally from a vertical list?
You can combine your lookup formula with the TRANSPOSE function to flip the orientation of the returned data. Alternatively, you can use horizontal lookup functions like HLOOKUP depending on how your source data is structured.
Why is XLOOKUP returning a #NAME? error in my spreadsheet?
XLOOKUP is only available in newer versions (Excel 365, Excel 2021, and modern versions of WPS Office). If you see the #NAME? error, your version does not support XLOOKUP, and you must use the INDEX and MATCH solution instead.




