How to Use VLOOKUP Across Multiple Excel Files and Worksheets

The VLOOKUP function is one of Excel’s most popular tools for retrieving data from tables. While it typically works within a single table or sheet, there are ways to extend its capabilities to lookup values across multiple files.

Consolidating data from multiple Excel files

To consolidate data from multiple Excel files, you can use the Consolidate function in Excel.

  1. In the new Excel file, go to the Data tab and click the Consolidate button.
  2. In the Consolidate dialog box, choose a function (e.g., SUM, AVERAGE, etc.) to apply to your data.
  3. In the Reference field, select the ranges from different files that you want to consolidate. If your ranges are in separate files, you’ll need to open each file and select the appropriate range.

Now that your data is consolidated, you can use the VLOOKUP function to retrieve information from this combined dataset.

Using the VLOOKUP function to retrieve values from a consolidated Excel file

Once you have consolidated the data from all of the Excel files into a single Excel file, you can use the VLOOKUP function to lookup values in the consolidated Excel file.

To use the VLOOKUP function to lookup values in a consolidated Excel file.

For example, the following formula would lookup the value in cell A2 in the column B of the table_array:

=VLOOKUP(A2, table_array, 2)

If the table_array is in another Excel file, you need to specify the name of the Excel file and the worksheet name in the table_array argument.

See also  How to VLOOKUP Another Column?

For example, the following formula would lookup the value in cell A2 in the column B of the table_array in the worksheet Sheet2 of the Excel file Example_Name.xls:

=VLOOKUP(A2, [Example_Name.xls]Sheet2!A1:B200, 2)

vlookup multiple files

Combining VLOOKUP with INDIRECT Function

You can use a combination of the VLOOKUP and INDIRECT functions to retrieve values from multiple Excel files dynamically. The INDIRECT function converts a text string into a cell reference, allowing you to pull data from various files without manually opening them. Here’s how:

  1. Open the Excel file that contains the lookup values.
  2. Create a new worksheet and name it “Criteria”.
  3. In the Criteria worksheet, enter the names of the Excel files that contain the data you want to retrieve.
  4. Select the Criteria worksheet and go to the Data tab.
  5. In the Advanced Filter dialog box, select the Criteria range option and specify the range of the Criteria worksheet.

This will create a new worksheet that contains all of the data from the Excel files that you specified in the Criteria worksheet.

Once you have created the new worksheet, you can use the VLOOKUP function to retrieve values from the data.

For example, the following formula will retrieve the value from cell A2 in the Sheet2 worksheet of the Book2.xlsx file:

=VLOOKUP($A$2,INDIRECT(“[Book2.xlsx]Sheet2!A1:B200”),2)

The INDIRECT function takes a text string as an argument and returns the value of the cell that is referenced by the text string. In this case, the text string is “[Book2.xlsx]Sheet2!A1:B200”, which references the range of cells in the Sheet2 worksheet of the Book2.xlsx file.

You can use this same technique to retrieve values from multiple Excel files. Simply enter the names of the Excel files in the Criteria worksheet and use the VLOOKUP function to retrieve values from the new worksheet that is created by the Advanced Filter.