How to Use a Cell's Text as an External Reference in Excel
Question details
The user wants to use a text string stored in a cell (which represents a file path and range) as an actual external reference in a formula like VLOOKUP.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Creating dynamic formulas where the target external workbook or worksheet reference is stored as plain text in another cell.
- Observed behavior
- Standard lookup functions cannot natively convert a text string containing a file path into a usable range reference, leading to calculation errors.
Ensure that the external workbook you are trying to reference is saved and accessible on your device. The formula you will use requires the referenced external workbook to remain open during calculation to work correctly.
Use the INDIRECT Function to Convert Text to a Reference
The INDIRECT function evaluates a text string and converts it into a valid cell reference, making it perfect for creating dynamic external links in your formulas.
When you store a file path like 'C:\Temp\[ExampleWorkbook.xlsx]Sheet1'!A1 in a cell, you can wrap that cell reference with INDIRECT() to tell the spreadsheet program to treat the text as an actual data location.
Type the full external reference path as text into a cell (for example, cell CB5). Ensure the format accurately includes the file path, workbook name enclosed in brackets, sheet name, and cell range.
In your target formula, replace the hardcoded data range with the INDIRECT function pointing to your text cell. For example, enter =VLOOKUP($A8, INDIRECT($CB$5), $B$2, FALSE) in the desired cell.
Open the external workbook you are referencing. The INDIRECT function requires the source workbook to be open in the background to successfully pull the data and avoid errors.

Dynamically Link Workbooks with WPS Spreadsheet
WPS Office provides a highly compatible and lightweight spreadsheet tool that fully supports advanced functions like INDIRECT and VLOOKUP, allowing you to easily manage dynamic data across multiple workbooks.
- 1. Open WPS Spreadsheet: Launch WPS Spreadsheet and load both your main workbook and the external data workbook you want to reference.
- 2. Input the Reference String: Enter the target workbook's exact path and data range as a text string into a dedicated reference cell.
- 3. Calculate using INDIRECT: Use the =INDIRECT() function within your data processing formulas to dynamically fetch the external data seamlessly.

Frequently Asked Questions
Why does my INDIRECT formula return a #REF! error when linking externally?
This usually happens because the external workbook referenced by the text string is currently closed. The INDIRECT function intrinsically requires the source file to be open in the background to evaluate and fetch external links.
What is the correct text format for an external reference in Excel?
The standard format requires single quotes surrounding the path and sheet name, followed by an exclamation mark and the cell range: 'C:\Folder Path\[WorkbookName.xlsx]SheetName'!CellRange. The single quotes are especially crucial if the path or sheet name contains spaces.
Can I use INDIRECT to reference a different sheet within the same workbook dynamically?
Yes. If you only want to reference a different sheet within your current workbook, you can enter just the sheet name and range (e.g., 'Sheet2'!A1:B10) into the cell and use the INDIRECT function to pull data from it.




