VLOOKUP Data from Another Workbook as per List of Sheets Name

Abstract: Resolve VLOOKUP errors when referencing multiple sheets in another workbook by using INDIRECT to dynamically construct external file paths based on a list of sheet names.

Created: 2026-09-10 by

You can retrieve data from another workbook by constructing a VLOOKUP formula that references the external file path, target sheet name, and column index. To automate this for multiple sheets, store the sheet names in a list and use the INDIRECT function to dynamically resolve the reference, ensuring your source workbook is closed or open as required.

Understanding External References

When you create a VLOOKUP formula that points to a different Excel file, Excel generates a complex string known as an external reference. This string typically includes the full file path, the filename enclosed in single quotes, and the specific sheet name. For example, if you are looking up data from a file named SalesData.xlsx located on your desktop, the reference might look like 'C:\Users\Name\Desktop\[SalesData.xlsx]Sheet1'!A:B.

The critical component here is the sheet name. In standard VLOOKUP usage, you manually type the sheet name into the formula. However, when dealing with a list of sheet names, typing each one individually is inefficient and prone to errors. The goal is to make the sheet name part of the reference dynamic so it changes based on a cell value. This requires breaking down the external reference string into parts that can be concatenated.

The Structure of the Reference

An external reference consists of three main parts: the file path and name, the sheet name, and the range within that sheet. To use a variable sheet name, we must isolate the sheet name portion. If your source workbook is always in the same location, the file path remains constant. We can hardcode the static parts of the path and only vary the sheet name. This approach simplifies the formula significantly compared to trying to parse the entire file path dynamically.

Preparing Your Data List

Before writing the formula, you need a structured way to manage the sheet names. Create a new worksheet in your destination workbook (the one where you want the results). In this sheet, create a column labeled "Sheet Name" and list all the sheet names from the source workbook that you wish to query. Ensure these names match exactly with the tab names in the source file, including capitalization and any special characters.

It is also helpful to define a Named Range for this list of sheet names. Select the cells containing the sheet names, go to the Formulas tab, and click Define Name. Call this range SourceSheets. This allows you to refer to the entire list easily in subsequent formulas or dropdowns, making your spreadsheet more maintainable. If you add new sheets to the source workbook, simply extend this list, and your formulas will automatically account for them.

Constructing the Dynamic Formula

The core solution involves using the INDIRECT function combined with text concatenation. The INDIRECT function takes a text string and converts it into a valid cell reference. By building the text string dynamically, you can point VLOOKUP to different sheets based on the row you are processing.

Assume your list of sheet names starts in cell A2. You want to look up a value from column B in your current sheet against column A in the source sheet. The formula structure would look like this:

=VLOOKUP(B2, INDIRECT("'" & "[SourceFile.xlsx]" & A2 & "'!$A:$B"), 2, FALSE)

Let's break down the INDIRECT argument. The first part is a single quote followed by the square brackets containing the filename. Note that the filename inside the brackets must match the actual source file name. Next, we concatenate the sheet name from cell A2. Finally, we close the quote and specify the range $A:$B. The dollar signs ensure the range does not shift if you copy the formula down.

Handling Open vs. Closed Workbooks

A common issue arises depending on whether the source workbook is open or closed. If the source workbook is closed, Excel requires the full file path in the reference. If it is open, you can often get away with just the filename. To ensure reliability, it is best practice to include the full path if possible, or keep the source workbook open while calculating. If you receive a #REF! error, check if the source file path has changed or if the file is missing.

If you need to handle varying file paths, you can include the path in a separate cell and concatenate it into the formula as well. However, storing sensitive path information in visible cells is not ideal. Instead, you can hide the cell containing the path or use a hidden helper column to build the complete reference string.

Implementing the Solution Step-by-Step

To implement this efficiently, follow these steps:

  1. Identify the Source File: Determine the exact name and location of the workbook containing your data. If the location is fixed, note the path.
  2. List Sheet Names: Manually or programmatically extract the sheet names from the source workbook and place them in a column in your destination workbook.
  3. Create Helper Columns: It is often easier to build the reference string in a helper column first. In cell C2, enter the formula: ="'" & "[SourceFile.xlsx]" & A2 & "'!$A:$B". Drag this down for all sheet names.
  4. Apply VLOOKUP: In your final output column, use =VLOOKUP(lookup_value, INDIRECT(C2), col_index, FALSE). This separates the reference construction from the lookup logic, making debugging easier.
  5. Verify Results: Check a few rows to ensure the data matches what you see in the source workbook. If values are #N/A, verify the lookup key exists in the source sheet.

This method provides a scalable solution. As your list of sheets grows, you only need to update the list in column A, and the rest of the spreadsheet updates automatically. This avoids the tedious process of rewriting formulas for each individual sheet.

Common Pitfalls and Solutions

One frequent error is mismatched sheet names. Excel is case-sensitive regarding the text string but not strictly about the sheet tab display. However, spaces and underscores matter. Ensure there are no trailing spaces in your list of sheet names. You can use the TRIM function to clean up your list if necessary.

Another issue is performance. If you have hundreds of sheets and large datasets, using INDIRECT with volatile functions can slow down calculation times. In such cases, consider using Power Query to merge data from multiple sheets instead of relying on worksheet formulas. Power Query is designed for handling multiple sources and updating data without the overhead of cell-by-cell calculations.

For users who frequently switch between workbooks, remember that external links require the source file to be accessible. If you move the source file, all links break. Use the Edit Links feature under the Data tab to update the file paths accordingly. For more details on managing external links, you might find our guide on VLookup using Excel sheet to get data from another workbook useful, which covers basic external reference management.

Frequently Asked Questions

Why do I get a #REF! error with my VLOOKUP?

This error usually means the reference string built by INDIRECT is invalid. Check that the sheet name in your list exactly matches the tab name in the source workbook, including spaces. Also, verify that the source file path is correct and the file still exists in that location.

Can I use this method if the source workbook is password protected?

No, standard VLOOKUP with INDIRECT cannot bypass password protection. You must open the source workbook with the password before the formula can read the data. If real-time collaboration is needed, consider using co-authoring features or exporting data to a shared location.

How do I handle sheet names with spaces in them?

Sheet names with spaces must be enclosed in single quotes within the reference string. The CONCATENATE logic shown above handles this by adding the quotes around the filename and sheet name combination. Ensure your list of sheet names does not include the quotes themselves, as the formula adds them.

Is there a limit to how many sheets I can look up?

There is no strict limit imposed by VLOOKUP itself, but performance will degrade with very large numbers of sheets and large ranges. For thousands of sheets, Power Query or VBA macros are more efficient solutions than cell formulas.

What if the source workbook is on a network drive?

Network drives work fine, but ensure the path is stable. Using UNC paths (e.g., \\Server\Folder) is more reliable than mapped drive letters (e.g., Z:\Folder) because mapped drives can change per user. Update your formula to use the UNC path if you share the workbook with others.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More