How to Look Up IDs Across Multiple Excel Worksheets
Question details
The user needs to look up a specific ID across several separate worksheets and retrieve a corresponding value from another column.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Searching for a specific identifier in a dataset that spans across multiple worksheet tabs instead of a single consolidated table.
- Observed behavior
- Standard functions like VLOOKUP cannot natively use multiple non-contiguous worksheet ranges as a single lookup array, requiring a workaround to stack or chain the data.
Ensure that all the worksheets you want to search have a consistent data structure, with the lookup IDs and return values located in corresponding columns across all sheets.
Combine Ranges Using VSTACK and Search with XLOOKUP
Use the VSTACK function to vertically stack your data arrays into one continuous array, then search through the combined dataset using XLOOKUP.
This method utilizes dynamic array functions available in modern versions of Excel. By wrapping the formula in the LET function, you can define your stacked arrays as variables, making the formula cleaner and easier to read.
Click on the cell where you want the final lookup result to be displayed.
Begin your formula by typing =LET( to define variables for your stacked arrays.
Define the 'ids' variable by vertically stacking the ID columns from all your sheets: ids, VSTACK(Sheet1!A2:A100, Sheet2!A2:A100, Sheet3!A2:A100, Sheet4!A2:A100, Sheet5!A2:A100, Sheet6!A2:A100).
Define the 'values' variable by stacking the return columns in the exact same sheet order: values, VSTACK(Sheet1!R2:R100, Sheet2!R2:R100, Sheet3!R2:R100, Sheet4!R2:R100, Sheet5!R2:R100, Sheet6!R2:R100).
Complete the formula by searching for your target ID (e.g., cell A2) within the defined variables: XLOOKUP(A2, ids, values, "Not found")).
Press Enter to apply the formula. Drag the fill handle down to apply it to additional rows if needed.

Chain Multiple VLOOKUPs with IFERROR
If you do not have access to dynamic array functions, you can nest multiple VLOOKUP functions inside IFERROR functions to search sheet by sheet sequentially.
Effortlessly Manage Multiple Worksheets with WPS Spreadsheet
WPS Spreadsheet provides powerful data processing capabilities, supporting advanced formulas and reference functions to help you consolidate, search, and analyze data across multiple worksheets with ease.
- 1. Open your workbook in WPS Office: Launch WPS Spreadsheet and open the file containing your multiple worksheets.
- 2. Access the Formula tab: Navigate to the Formula tab on the top ribbon to explore a comprehensive library of built-in functions.
- 3. Apply lookup functions: Use the formula bar to input your nested functions or lookup references to link data across different tabs seamlessly.
- 4. Save in standard formats: Save your consolidated workbook in the universally compatible .xlsx format to ensure easy sharing with Microsoft Office users.

Frequently Asked Questions
Why does my XLOOKUP return a #VALUE! error when using VSTACK?
This usually happens if the stacked arrays for your lookup IDs and your return values are not exactly the same size. Ensure that the ranges defined in your VSTACK formula cover the exact same number of rows for every worksheet.
Can I use standard VLOOKUP across multiple sheets directly without nesting?
No, standard VLOOKUP requires a single, continuous lookup array. To search across multiple sheets, you must either stack the data virtually (like with VSTACK), combine the data into a master sheet manually, or use nested IFERROR functions.
How do I perform a lookup if my sheet names contain spaces?
If your worksheet names include spaces, you must enclose the sheet name in single quotation marks within your formula. For example, use 'Data Sheet 1'!A2:A100 instead of Data Sheet 1!A2:A100 so the formula correctly parses the tab name.




