Populate an Excel Search Form with XLOOKUP from Multiple Worksheets
Question details
The user needs to populate a search form to retrieve matching records from a large dataset distributed across multiple worksheets using lookup functions.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Creating a searchable interface to return specific genealogy or cemetery records that are currently split across multiple spreadsheet tabs.
- Observed behavior
- Looking up data directly across multiple disparate sheets is complex; it is more effective to combine the data into a single source table to apply XLOOKUP or FILTER functions.
Ensure all your source worksheets have identical column headers so they can be seamlessly combined. Decide whether your search needs to return a single matching record or multiple potential matches before choosing your lookup formula.
Consolidate Sheets and Apply the FILTER Function
Combining your worksheets into one master table makes it easier to use the FILTER function, which is ideal when multiple records might match your search criteria.
When dealing with databases like genealogy records, a search for a last name might yield multiple results. The FILTER function is better suited for this than XLOOKUP because it spills all matching rows into your search form automatically.
Copy all records from your various sheets (e.g., A-Peterson and Petree-Z) and paste them into a single worksheet. Select the combined range and press Ctrl+T to convert it into an Excel Table, naming it 'People'.
In a new sheet designated as your Search Form, assign specific cells for your search criteria. For example, use cell B2 for 'Last Name' and cell B3 for 'First Name'.
In the cell where you want the search results to begin appearing, enter the formula: =FILTER(People, (People[Last Name]=B2)*(People[First Name]=B3), "No match").
Press Enter. The formula will dynamically spill all matching records into the adjacent cells. If no records match the criteria, it will display 'No match'.

Use XLOOKUP with Multiple Criteria for Single Results
If you only need to return a single, unique record, XLOOKUP combined with multiple search keys concatenated together is the simplest method.
Create Search Forms Easily in WPS Spreadsheet
WPS Spreadsheet provides full support for advanced dynamic array functions like XLOOKUP and FILTER, allowing you to build powerful search forms and consolidate data across multiple worksheets effortlessly.
- 1. Open your data in WPS Spreadsheet: Launch WPS Office, open your workbook, and view your multiple worksheets.
- 2. Merge your data: Use the 'Merge Sheet' tool found under the Data tab to quickly consolidate multiple worksheets into one master table.
- 3. Input your formula: Type your XLOOKUP or FILTER formula into your search form sheet just as you would in Excel.
- 4. Save and share: Save your dynamic search form in .xlsx format to ensure full compatibility with Excel users.

Frequently Asked Questions
Can I use XLOOKUP across multiple sheets without consolidating them first?
While possible using complex nested IFERROR functions or the VSTACK function (e.g., =XLOOKUP(val, VSTACK(Sheet1!A:A, Sheet2!A:A), VSTACK(Sheet1!B:B, Sheet2!B:B))), it is highly recommended to consolidate data into a single table first to avoid slow calculation speeds and difficult-to-maintain formulas.
Why does my FILTER formula return a #CALC! error?
The #CALC! error typically occurs when the FILTER function finds no matches and you haven't provided a third argument (the [if_empty] parameter). Add a default string like "No match" at the end of your formula to resolve this.
What is the difference between FILTER and XLOOKUP in this scenario?
XLOOKUP is designed to return the first single match it finds based on your criteria. FILTER is a dynamic array function that returns all rows that match your criteria, making it much better for searches like last names where multiple people might share the same name.
Does WPS Office support the XLOOKUP and FILTER functions?
Yes, the latest versions of WPS Spreadsheet fully support modern dynamic array functions, including XLOOKUP, FILTER, UNIQUE, and SORT, ensuring seamless compatibility with modern Excel files.




