Use a Variable Sheet Name in an Excel VLOOKUP Formula
Question details
Use a sheet name stored in a cell as part of an Excel VLOOKUP reference.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- The user wants to switch a lookup between worksheets by changing the sheet name in a cell.
- Observed behavior
- The lookup should read the specified worksheet and return a matching value from its data range.
Check that each data worksheet has lookup values in column A and return data within A3:D136. Confirm that the sheet name cell matches an existing worksheet and that the return-column number is between 1 and 4.
Combine VLOOKUP and INDIRECT to Reference a Sheet Name
Use this formula when a cell contains the name of the worksheet to search.
INDIRECT converts the sheet name and range into a reference that VLOOKUP can search. Single quotes around the sheet name allow names containing spaces.
In cell B17, type the exact name of the worksheet containing the lookup data, such as Sales Data.
Enter the value to find in A18. Enter a return-column number from 1 to 4 in E5; for example, enter 2 to return a value from column B.
Select the cell where you want the result and enter =VLOOKUP($A18,INDIRECT("'"&$B17&"'!$A$3:$D$136"),E$5,FALSE). Press Enter.
Change the sheet name in B17 to another existing worksheet name. The formula will search that worksheet's A3:D136 range.

Create a Dynamic Sheet Lookup in WPS Spreadsheets
Use VLOOKUP and INDIRECT in WPS Spreadsheets to search a worksheet named in a cell and change the source without rewriting the formula.
- 1. Open the workbook: Open WPS Spreadsheets and use Open to select your Excel workbook.
- 2. Enter the inputs: Type the source worksheet name in B17, the lookup value in A18, and a return-column number from 1 to 4 in E5.
- 3. Add the lookup formula: Select the result cell and enter =VLOOKUP($A18,INDIRECT("'"&$B17&"'!$A$3:$D$136"),E$5,FALSE), then press Enter.
- 4. Change the source sheet: Edit B17 to another existing worksheet name to look up data in that sheet's A3:D136 range.

Frequently Asked Questions
Why does the formula return #REF!?
Check that B17 matches an existing worksheet name and that the referenced range is valid. If the sheet name contains an apostrophe, use SUBSTITUTE($B17,"'","''") in the INDIRECT expression.
Why does VLOOKUP return #N/A?
With FALSE as the last argument, VLOOKUP requires an exact match. Check that A18 appears in column A of the selected sheet's A3:D136 range and that the values have matching data types.
Do I need quotes around every sheet name?
Single quotes are needed for names with spaces and are safe to use for ordinary names. If the name has no spaces, INDIRECT($B17&"!$A$3:$D$136") also works.
Can I put the lookup range in a separate cell?
Yes. For example, put $A$3:$D$136 in C17 and use =VLOOKUP($A18,INDIRECT("'"&$B17&"'!"&$C$17),E$5,FALSE). The text in C17 must be a valid range reference.




