How to batch merge Excel files from multiple folders? Generate a separate table for each folder.


Translation:EnglishFrançaisDeutschEspañol日本語한국어
Update Time:2026-11-24 06:23:51
Content note: This article reflects the software version available when it was published. Interfaces and features may change with updates; please refer to the current software. If you find an error, please let us know.
Software featured in this articleHeSoft Doc Batch Tool
Free DownloadSoftware IntroductionUser Guide

When multiple folders each contain a batch of Excel spreadsheets, opening, copying, and consolidating them one by one is not only time-consuming but also prone to omissions, order errors, or duplicate header rows. This article explains how to use HeSoft Doc Batch Tool to add multiple folders containing Excel files to a task at once, and have each folder merged separately into an independent xlsx spreadsheet. By configuring file sorting, data merging method, header row, and output format, you can quickly complete folder-based batch consolidation of Excel files, suitable for department reports, project data, store ledgers, and similar scenarios.

In daily office work, we often encounter this kind of file structure: there are many folders on the computer, and each folder contains several Excel workbooks. The tables within the same folder need to be consolidated, while different folders must remain independent of each other. For example, the Excel files in folder "1" are merged into "1.xlsx", the Excel files in folder "2" are merged into "2.xlsx", and so on.

If there are only a few folders, manual copy and paste may seem manageable; however, as the number of folders and tables grows, repeatedly opening files, copying data, checking headers, and saving files takes up a lot of time, and problems such as missed merges, misplaced data, and disordered order can easily occur. This article introduces how to use the office software HeSoft Doc Batch Tool to batch merge many folders containing Excel files into multiple independent spreadsheet files. You can add multiple folders to the task at once and output the corresponding Excel results separately, thereby reducing repetitive work.

1. In which scenarios is this Excel batch merging method applicable

The processing method introduced here does not stuff all Excel files from all folders into one single master file. Instead, it performs merging on a per-folder basis: one source folder corresponds to one merged result. It is especially suitable for cases where the original files are already stored by department, person, date, region, or project.

1. Consolidate periodic reports by department

An enterprise may create separate folders for the sales department, finance department, operations department, and so on, with each folder containing multiple daily, weekly, or monthly reports. After batch processing, each department can obtain an independent consolidated Excel file without manual sorting one by one.

2. Merge business data by store or region

Data for chain stores is usually stored by store number, with multiple xlsx or xls files in each store folder. By merging folder by folder, you can generate separate summary files for each store, making subsequent statistics, review, and archiving easier.

3. Organize Excel materials by project

If each project folder contains progress tables, detail tables, or staged data, you can merge multiple Excel files within a project into one independent workbook or worksheet, avoiding mixing data from different projects.

4. Batch organize historical tables and ledgers

For folders created by year, month, customer, or employee, you can also add all directories at once and let the office software perform batch merging automatically. Compared with opening Excel files one by one and copying content, this method is more suitable for file organization tasks involving large quantities.

2. Result preview: what changes before and after processing

Before processing: multiple folders each containing Excel files

Before processing, the sample directory contains five folders: "1", "2", "3", "4", and "5". Each folder can contain one or more Excel workbooks that need to be consolidated, and the folder itself serves as the boundary for data classification.

image-Batch merge Excel folders,multiple Excel files into multiple files,batch merge Excel,merge folders into Excel,merge xlsx tables

Although this structure provides clear classification, if you need to view the complete content of a certain type of data, you have to enter the folder and open each table one by one. When there are many folders, manual consolidation creates a large amount of repetitive work.

After processing: each folder generates an independent Excel file

After batch processing is completed, the original five folders correspond to "1.xlsx", "2.xlsx", "3.xlsx", "4.xlsx", and "5.xlsx" respectively. In other words, the Excel files within each folder are merged separately, without mixing data from other folders.

image-Batch merge Excel folders,multiple Excel files into multiple files,batch merge Excel,merge folders into Excel,merge xlsx tables

As can be seen from the results, this feature is suitable for a "multiple folders, multiple output files" processing requirement. Folders serve as the input unit, and the merged Excel files serve as the output unit, preserving the original classification logic while eliminating the process of manually performing merges folder by folder.

3. Steps to batch merge Excel folders using the office software

The specific process is described below according to the order of the operation screenshots. Before formal processing, it is recommended to first check the table structures in each folder and close any source Excel files that are currently being edited to avoid file locking.

Step 1: Enter Excel Tools and select the corresponding function

Open HeSoft Doc Batch Tool . From the function area on the left side of the software, enter "Excel Tools", and in the function list find and select "Merge multiple Excel folders into multiple files".

image-Batch merge Excel folders,multiple Excel files into multiple files,batch merge Excel,merge folders into Excel,merge xlsx tables

The purpose of selecting this function is to make the software perform merging separately by folder, rather than merging all Excel files into one master file. The function description in the screenshot also indicates that it is used to batch merge multiple folders containing Excel files into multiple independent files. If the actual requirement is to centralize all tables into one result, you should distinguish it from other Excel merging functions to avoid selecting the wrong task type.

Step 2: Batch add the folders to be processed

After entering the task page, you are currently at step 1, "Select the records to be processed". Click "Add Folder" in the upper right corner of the page and add the Excel folders to be processed one by one.

image-Batch merge Excel folders,multiple Excel files into multiple files,batch merge Excel,merge folders into Excel,merge xlsx tables

In the example, five records have already been added, with names 1, 2, 3, 4, and 5, corresponding to their respective folder directories. The list displays the serial number, name, path, creation time, and modification time, making it easy to check the input range before processing.

After adding, it is recommended to focus on checking the following:

  • Whether the number of folders is consistent with the planned number to be processed;
  • Whether the paths point to the directories that actually store Excel files;
  • Whether empty folders or unrelated directories were added by mistake;
  • Whether folders with similar names were added repeatedly;
  • Whether each folder should generate a separate merged result.

If a record was added incorrectly, you can use the delete icon in the "Operations" column of that row to remove it; if you need to reselect everything, you can use "Clear" at the top of the page. After confirming that the list is correct, click "Next" at the bottom to enter processing option settings.

Step 3: Set the merge order of Excel files

In step 2, "Set processing options", you first need to choose the sorting method. The screenshot provides two options: "Merge in ascending order by name" and "Merge in descending order by name".

image-Batch merge Excel folders,multiple Excel files into multiple files,batch merge Excel,merge folders into Excel,merge xlsx tables

The sorting method affects the order in which multiple Excel files within the same folder are read and written into the result file. If file names are based on dates, serial numbers, or batches, it is recommended to choose ascending or descending order according to the actual business sequence. For example, when the file names are "01.xlsx", "02.xlsx", and "03.xlsx", ascending order by name usually better matches the habit of summarizing from front to back.

To make the sorting results more stable, source files should preferably use a consistent naming convention. If files use purely numeric names, you should also pay attention to the actual ordering relationship of "1, 2, 10" in name sorting. When there are many files, you can first standardize the number of digits, for example using "001, 002, 010", before performing the merge.

Step 4: Select the data merging method

The "data merging method" determines how Excel content within the same folder is written into the final file. The interface provides the following two methods:

  • Merge into one worksheet: The read data is continuously consolidated into the same worksheet. This is more suitable for Excel files with consistent column structures that need to form a single detailed master table.
  • Integrate into one workbook: The content is centralized into the same workbook. This is suitable when you want to preserve multiple worksheets within one Excel file.

If the fields and column order of the source tables are basically consistent, and subsequent filtering, statistics, or pivot table creation is needed, "Merge into one worksheet" is usually a good choice. If the tables serve different purposes, or if you want to retain relatively independent worksheet structures, you can consider "Integrate into one workbook".

In the screenshot, "Merge into one worksheet" is selected. This means that each source folder still generates only one independent Excel file, while the data from multiple tables within the folder will be consolidated into one worksheet in that result file.

Step 5: Set the header row retention rule

When multiple Excel files use the same header, directly splicing them in sequence may cause each file's header row to appear in the result data, creating duplicate headers. The software provides the "Keep only unique header rows" option to handle this situation.

After enabling this option, you also need to fill in "The first how many rows of all worksheets are headers". The value in the screenshot is 1, meaning that the first row of each table is treated as the header row. During merging, a unified header is retained, and duplicate headers in subsequent files are no longer repeatedly written as ordinary data.

The actual setting should be determined based on the source file structure:

  • If each table has field names only in the first row, you can fill in 1;
  • If the first two rows together form the header area, you can fill in 2 according to the actual situation;
  • If the number of header rows is inconsistent across files, it is recommended to first organize them into a unified structure before merging;
  • If the header contains merged cells or complex instructions, you should first test the results with a small number of files.

Whether the header row setting is accurate will directly affect the completeness of the merged data. A value that is too large may cause some valid data to be treated as headers, while a value that is too small may retain duplicate headers. Therefore, do not simply rely on the default value.

Step 6: Decide whether to add a report page as needed

The settings page also provides an "Add report page" switch. Whether to enable it can be determined according to the actual task requirements. If you only want a concise data merge result, you can keep it turned off; if you want the result to include corresponding processing report information, you can enable it according to the interface options.

Before formally batch processing a large number of folders, it is recommended to first select one or two representative directories for a trial run. After confirming that the data order, header rows, and worksheet organization meet expectations, process all directories, which can reduce the cost of rework.

Step 7: Confirm the merged file format

In "Merged file format type", you can choose "Keep the same format as the first file" or "Custom file format". In the screenshot, "Keep the same format as the first file" is selected.

If the source file formats are consistent, using the format of the first file is usually more straightforward. If different types of Excel files exist within the folder, or if there are clear format requirements for the output results, you should choose based on the custom options provided in the interface. Common Excel extensions include xlsx and xls, but the actual selectable range should be based on what is displayed on the current page of the software.

Step 8: Set the save location and start processing

After completing the above options, click "Next" and follow the task flow to enter "Set save location". It is recommended to choose an output directory with sufficient space that is easy to find, and avoid directly overwriting the original file locations as much as possible. After setting, enter the "Start processing" stage to execute the batch merge task.

After processing is complete, open the output directory to check the results. Under normal circumstances, each input folder will correspond to an independent Excel file. In the example, folders 1 to 5 ultimately produce 1.xlsx to 5.xlsx respectively. It is recommended to randomly open several result files and check whether the number of worksheets, number of data rows, header rows, and sorting are correct.

4. Common problems and precautions

1. Why choose "Merge multiple Excel folders into multiple files"

Because the core of this task is to keep folders independent of each other. If there are 10 source folders, the goal is usually to obtain 10 Excel results, rather than consolidating the contents of all 10 folders into one file. When selecting a function, it is important to distinguish between "one file" and "multiple files".

2. What to do if duplicate header rows appear after merging

First check whether "Keep only unique header rows" is enabled, and then confirm whether "The first how many rows of all worksheets are headers" is filled in correctly. If some tables have different numbers of header rows, you should first unify the source file structure; otherwise it is difficult to accurately process all files using the same rule.

3. What to do if data columns do not match or the content is misaligned

Batch vertical consolidation usually requires the source tables to have similar column structures. If some Excel files have added columns, adjusted column order, or used different field names, it is recommended to unify the template first. Batch tools can reduce mechanical operations, but they cannot replace checking the source data structure.

4. Why the file name order differs from expectations

The software sorts in ascending or descending order by name, and the result is affected by the file naming method. For file names with numbers, it is recommended to use a consistent number of digits and a fixed format, such as "2026-01", "2026-02", or "001", "002", to avoid ambiguous name ordering.

5. Can a large number of folders be processed directly

You can add multiple folders in batch, but when using a certain set of data for the first time, it is best to validate the settings with a small number of samples first. In particular, check the header rows, data merging method, and format type. Expanding the processing scope after testing is more efficient than reworking one by one after completion.

6. Will it matter if the source Excel file is currently open

To avoid file locking or unsaved content, it is recommended to save and close the relevant Excel workbooks before starting the task. At the same time, keep backups of the original files, and do not delete source files before verifying the results.

7. Where should output files be saved

It is recommended to create a separate results directory and note the date or task batch in the directory name. This can avoid confusion with source files and make it easier to compare the data before and after processing. If files with the same names already exist in the output directory, you should first move or back them up to prevent misjudgment caused by name conflicts.

5. Summary

The difficulty of merging many folders containing Excel files into independent tables lies not only in "merging", but also in preserving the original classification, controlling the reading order, handling duplicate headers, and determining the output format. Using HeSoft Doc Batch Tool , you can add multiple folders to the task at once and let the office software process them automatically according to unified rules, saving the steps of repeatedly opening xlsx and xls files and copying and pasting.

In actual operation, you only need to enter Excel Tools, select "Merge multiple Excel folders into multiple files", add all source folders, then set name sorting, data merging method, header rows, and file format, and finally specify the save location and start processing. For batch organization tasks such as departmental reports, store data, project ledgers, and historical archives, this method can significantly reduce repetitive work while lowering the risk of omissions and misplaced data.

It is recommended to first copy a set of source data as a backup, select one or two folders to complete testing, and then, after verifying that the results are correct, add the remaining folders to the task at once for batch merging.

Keyword:Batch merge Excel folders , multiple Excel files into multiple files , batch merge Excel , merge folders into Excel , merge xlsx tables
Creation Time:2026-11-24 06:23:35
Software featured in this articleHeSoft Doc Batch Tool
Free DownloadSoftware IntroductionUser Guide
Content note: This article reflects the software version available when it was published. Interfaces and features may change with updates; please refer to the current software. If you find an error, please let us know.