Function Problems

How to Look Up IDs Across Multiple Excel Worksheets

Anum MushtaqAnum Mushtaq Nov 11, 2026 869 views

Question details

The user needs to look up a specific ID across several separate worksheets and retrieve a corresponding value from another column.

How to Look Up IDs Across Multiple Excel Worksheets
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.
Before you start

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.

Solution 1Recommended

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.

1
Select the target cell

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

2
Start the LET function

Begin your formula by typing =LET( to define variables for your stacked arrays.

3
Stack the ID columns

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).

4
Stack the return value columns

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).

5
Add the XLOOKUP function

Complete the formula by searching for your target ID (e.g., cell A2) within the defined variables: XLOOKUP(A2, ids, values, "Not found")).

6
Execute the formula

Press Enter to apply the formula. Drag the fill handle down to apply it to additional rows if needed.

Combine Ranges Using VSTACK and Search with XLOOKUP
Version Compatibility: This solution requires a version of Excel that supports dynamic array functions, such as Excel 365 or Excel 2021. If you are using an older version, VSTACK will not be available.
Solve Function Problems with WPS Spreadsheet

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. 1. Open your workbook in WPS Office: Launch WPS Spreadsheet and open the file containing your multiple worksheets.
  2. 2. Access the Formula tab: Navigate to the Formula tab on the top ribbon to explore a comprehensive library of built-in functions.
  3. 3. Apply lookup functions: Use the formula bar to input your nested functions or lookup references to link data across different tabs seamlessly.
  4. 4. Save in standard formats: Save your consolidated workbook in the universally compatible .xlsx format to ensure easy sharing with Microsoft Office users.
Supports advanced lookup and reference functions for complex multi-sheet queriesFully compatible with Microsoft Excel file formats (.xls, .xlsx, .csv)Lightweight and fast, ensuring smooth performance even with large multi-sheet workbooksFree to download and use with a highly intuitive, tabbed user interface
microsoft office alternative - wps office

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.