logo
search
Function Problems

How to Dynamically Change Excel VLOOKUP Data Ranges with a Dropdown

WPS Content ManagerWPS Content Manager Sep 30, 2026 869 views

Question details

The user wants a dynamic control, such as a button or checklist, to automatically switch the data ranges used by VLOOKUP formulas to reference different client worksheets.

How to Dynamically Change Excel VLOOKUP Data Ranges
Product
Excel
Device & OS
not provided
Scenario
Creating an invoice or report that needs to pull data from various client-specific price lists without manually updating the VLOOKUP formula each time the client changes.
Observed behavior
The user is seeking a method to replace static VLOOKUP table arrays with dynamic references that update based on user selection.
Before you start

Ensure that the names of your client worksheets are finalized and do not contain special characters. You will need a master list of these sheet names typed exactly as they appear on the sheet tabs.

Solution 1Recommended

Use a Data Validation Dropdown and the INDIRECT Function

Combine Excel's Data Validation feature with the INDIRECT function to seamlessly switch the target worksheet inside your VLOOKUP formula.

The most efficient way to switch VLOOKUP ranges without using macros is by utilizing the INDIRECT function. INDIRECT converts a text string into a valid cell reference.

By linking this text string to a dropdown list (created via Data Validation) that contains your worksheet names, your VLOOKUP formula will automatically adjust its search range whenever a new client is selected.

1
List the Worksheet Names

On your main invoice sheet or a dedicated settings sheet, type out the exact names of all your client worksheets in a single column (e.g., A1:A5).

2
Create a Dropdown List

Select the cell where you want the client selection control (e.g., C1). Go to the 'Data' tab and click 'Data Validation'. Under the 'Allow' dropdown, choose 'List', and for the 'Source', highlight the range containing your worksheet names.

3
Write the Dynamic VLOOKUP Formula

In the cell where you want the result, enter your VLOOKUP formula using INDIRECT to reference the selected sheet. For example: =VLOOKUP(B2, INDIRECT("'" & C1 & "'!A1:D100"), 2, FALSE). Here, C1 is the dropdown cell, and A1:D100 is the data range on the client sheets.

Use a Data Validation Dropdown and the INDIRECT Function
Syntax Tip: Always include the single quotation marks inside the INDIRECT text string (e.g., "'"). This ensures the formula won't break if your worksheet names contain spaces.
Advanced Spreadsheet Functions

Easily Manage Dynamic VLOOKUP Ranges in WPS Spreadsheet

WPS Spreadsheet provides powerful built-in tools like Data Validation and the INDIRECT function to help you create dynamic, automated invoices and reports. Easily switch between client price lists without complicated macro setups.

  1. 1. Open Your Workbook: Launch WPS Spreadsheet and open the invoice file containing your client data sheets.
  2. 2. Set Up Data Validation: Go to the Data tab, click Data Validation, and select 'List' to create a dropdown menu using your client sheet names.
  3. 3. Apply the Formula: Enter the formula =VLOOKUP(lookup_value, INDIRECT("'" & Dropdown_Cell & "'!Range"), col_index, FALSE) into your target cell.
  4. 4. Test the Dropdown: Select different clients from your newly created dropdown list to watch the VLOOKUP results update instantly based on the correct sheet.
Fully compatible with Microsoft Excel formulas like VLOOKUP and INDIRECTFree and lightweight alternative to heavy spreadsheet applicationsIntuitive Data Validation interface for creating dropdown lists effortlesslySeamlessly handle multi-sheet data lookups and reporting
microsoft office alternative - wps office

Frequently Asked Questions

Why is my INDIRECT function returning a #REF! error?

This usually happens if the worksheet name contains spaces but isn't wrapped in single quotes within the formula, or if the sheet name does not exist. Ensure your INDIRECT reference strictly follows the syntax: INDIRECT("'" & C1 & "'!A1:D100").

Can I use a Checkbox instead of a Dropdown List?

Yes, you can link a Form Control Checkbox to a cell (e.g., D1) which will output TRUE or FALSE. You can then use an IF statement inside your VLOOKUP to switch between two distinct data ranges, such as: =VLOOKUP(A2, IF(D1=TRUE, Sheet1!A1:B10, Sheet2!A1:B10), 2, FALSE). However, this only works well for toggling between two choices.

Will using the INDIRECT function slow down my spreadsheet?

The INDIRECT function is a 'volatile' function, meaning it recalculates every time any change is made in the workbook. While it works perfectly for invoices and standard reports, using thousands of INDIRECT formulas simultaneously may cause performance slowdowns.