Data Import & Export

How to Import Excel Data from Multiple Folders to a Master Workbook

Huma Ashraf ChHuma Ashraf Ch Nov 3, 2026 869 views

Question details

The user needs to extract specific cell values from multiple Excel workbooks located across various server folders and compile them into a single master workbook.

How to Import Excel Data from Multiple Folders to a Master Workbook
Product
Excel
Device & OS
not provided
Scenario
Compiling inspection data from scattered Excel files into a single master workbook, bypassing non-Excel files like PDFs and images stored in the same directories.
Observed behavior
If Power Query attempts to process non-Excel files in those folders, it throws an error. The user also requires that the master workbook does not maintain live links to the source files once the data is successfully collected.
Before you start

Identify the main root folder path that contains all your target Excel files, and note the common file extensions (.xlsx, .xls) for the workbooks you want to import to help isolate them from PDFs and images.

Solution 1Recommended

Use Power Query to Extract and Filter Excel Data

Retrieve files from a root folder and filter by file extension to ensure only Excel workbooks are processed, avoiding formatting errors from PDFs and images.

Power Query allows you to target a main directory and dynamically pull data from its subfolders. To prevent errors caused by attempting to read images or PDFs as Excel workbooks, you must filter out non-Excel files before expanding the binary content.

1
Launch Power Query from Folder

Open your master workbook, go to the 'Data' tab on the ribbon, and select 'Get Data' > 'From File' > 'From Folder'.

2
Select the Root Server Folder

Enter or browse for the path to the main server folder containing your scattered subfolders and inspection files, then click 'OK'.

3
Open the Power Query Editor

In the preview window that appears, click 'Transform Data' instead of Load. This opens the advanced Power Query Editor where you can refine the file list.

4
Filter Out Non-Excel Files

Click the drop-down arrow on the 'Extension' column header and apply a filter to only include '.xlsx' or '.xls'. Uncheck all other extensions like .pdf, .png, or .jpg.

5
Combine the Filtered Files

Click the 'Combine Files' icon (double downward arrows) in the 'Content' column header to extract the actual Excel data from the filtered files.

6
Load to Master Workbook

Format the combined data as needed, then click 'Close & Load' in the Home tab to push the isolated plain text data directly to your master workbook.

Use Power Query to Extract and Filter Excel Data
No Live Links Required: Once the data is loaded into the master workbook, it functions as stored values. The source inspection files can be moved, deleted, or revised without instantly breaking your master list, as long as you do not manually refresh the query.
Free Microsoft Office alternative

Easily Manage Multiple Workbooks with WPS Office

While advanced Power Query automations are Microsoft Excel specific features, you can seamlessly open, manage, and manually consolidate Excel workbooks using WPS Office. It offers high compatibility with Microsoft formats, a familiar interface, and excellent data processing tools—completely free.

  1. 1. Download WPS Office: Visit the official WPS website to download and install the free WPS Office suite.
  2. 2. Open Your Workbooks: Launch WPS Spreadsheets and easily open your master .xlsx file alongside your inspection reports.
  3. 3. Consolidate Data: Use WPS Spreadsheets' intuitive Data tools to copy, organize, and consolidate values efficiently without needing complex M-code.
100% compatible with Microsoft Excel (.xlsx, .xls) files and formulas.Lightweight installation that runs smoothly on older devices and servers.Built-in tabbed interface for easily managing multiple open inspection files.Free alternative with robust data consolidation and extraction tools.
microsoft office alternative - wps office

Frequently Asked Questions

Why do I get an error when importing files from a folder using Power Query?

This usually happens when Power Query attempts to read non-Excel files (like PDFs, JPGs, or hidden system files) as Excel workbooks. You must filter the 'Extension' column to only include .xlsx or .xls before expanding the 'Content' column.

Will my master workbook break if I delete the original inspection files?

If you use Power Query to load the data, the imported results remain stored as text/values in your master workbook even if the source files are moved or deleted. However, triggering a query refresh will cause an error if the source files are missing from the original path.

Do all source files need to be saved in the exact same folder for Power Query to work?

No. When using the 'From Folder' option, Power Query automatically retrieves files from all subfolders within the main root folder you select. Just ensure your main path is high enough in the directory tree to encompass all your inspection folders.

Can I import only specific cells rather than the whole spreadsheet?

Yes. Once the files are combined in the Power Query Editor, you can select only the columns you need, remove the rest, and apply row filters to keep only the specific data parameters required for your master workbook before loading it.