How to Import Data Based on a Dropdown Selection in Excel
Question details
The user needs a scalable formula to import data from different sheets based on a dropdown selection, without manually updating the formula for every new addition.

- Product
- Spreadsheets
- Device & OS
- not provided
- Scenario
- Managing a recipe workbook where a summary sheet dynamically pulls nutrition information based on the user's dropdown choice.
- Observed behavior
- The current approach uses a long IFS formula that hardcodes sheet names, making it difficult to maintain and requiring manual edits whenever a new recipe is added.
Ensure all your recipe sheets or master data tables share a consistent layout so that formulas can reliably pull data from the same cell ranges regardless of the item selected.
Use a Master Lookup Table with XLOOKUP
Consolidating data into a single master sheet is the most scalable way to look up information dynamically.
Instead of keeping every recipe on a separate worksheet, maintain a central database. This eliminates the need for complex cross-sheet formulas and makes adding new recipes effortless.
Create a new sheet named 'MasterData'. List all recipe names in Column A, and their corresponding nutrition values in adjacent columns (e.g., Columns B through I).
On your main summary sheet, select cell B2, go to the Data tab, and use Data Validation to create a dropdown list referencing your recipe names.
In the cell where you want the data to appear, enter the formula: =XLOOKUP(B2, MasterData!A:A, MasterData!B:I, ""). This searches for the selected recipe in Column A and returns the corresponding data array from Columns B through I.
Whenever you add a new recipe, simply append it to the bottom of the 'MasterData' sheet. Your formula will automatically recognize the new entry without any manual edits.

Use the INDIRECT Function for Dynamic Sheet References
If recipes must remain on separate sheets, use INDIRECT to dynamically reference the sheet name selected in the dropdown.
Build Dynamic Lookup Tables with WPS Spreadsheet
WPS Spreadsheet offers full support for advanced lookup functions like XLOOKUP and INDIRECT, making it incredibly easy to pull and manage data dynamically from multiple worksheets.
- 1. Open Your Data: Launch WPS Spreadsheet and open your multi-sheet workbook.
- 2. Configure the Dropdown: Navigate to the 'Data' tab and click 'Validation' to easily set up your dynamic dropdown menu.
- 3. Apply the Function: Type =XLOOKUP( or =INDIRECT( in your target cell to seamlessly pull data based on the dropdown.
- 4. Automate Your Workflow: Press Enter. Your dashboard will now automatically refresh its data whenever a new selection is made.

Frequently Asked Questions
Why is my INDIRECT formula returning a #REF! error?
A #REF! error with INDIRECT usually means the referenced sheet name does not exist, or the sheet name contains spaces and you forgot to wrap the reference in single quotes within your formula (e.g., INDIRECT("'" & B2 & "'!A1")).
Is it better to use XLOOKUP or INDIRECT for pulling data?
XLOOKUP combined with a centralized master data table is generally better because it is more scalable and robust. INDIRECT is a volatile function that recalculates on every workbook change, which can significantly slow down performance on larger files.
How do I automatically update my dropdown list when I add new items?
Format your list of recipe names as a Table (Ctrl+T or Insert > Table). Then, point your Data Validation dropdown to that specific table column. As you append new items to the table, your dropdown menu will expand dynamically.
Can I pull an entire array of data instead of a single cell using XLOOKUP?
Yes, XLOOKUP natively supports returning arrays. By selecting a multi-column range as your return array (for example, MasterData!B:I), the formula will automatically spill the retrieved data across multiple adjacent columns.




