How to merge excel files into one file
Tutor 5 (68 Reviews)
Excel Tutor
Still stuck with a Excel question
Ask this expertAnswer
The process of merging Excel files into one file is the method of combining data from multiple workbooks into a single unified workbook. The objective is to centralize data for analysis, reporting, or storage. To merge Excel files into one file, follow a structured method that fits the type of data and the number of files involved. Each method helps create a single workbook that contains sheets or consolidated tables from different files.
Method 1: Use Copy and Paste
This method supports quick merging for smaller files.
-
Open all workbooks you want to merge.
-
Select the entire worksheet by selecting the corner button near row 1 and column A.
-
Press Ctrl + C on Windows or Command + C on Mac.
-
Open the destination workbook.
-
Create a new sheet by selecting +.
-
Press Ctrl + V on Windows or Command + V on Mac.
Method 2: Merge Files Using Power Query
Power Query is built into Excel on Windows and Mac. Windows supports a broader connector set than Mac.
Windows Steps
-
Place all source Excel files in one folder.
-
Open a new workbook.
-
Go to Data > Get Data > From File > From Folder.
-
Select the folder that contains your files.
-
Select Combine & Load.
-
Review the preview to confirm column structures.
-
Load the merged data into a new worksheet.
Mac Steps
Power Query runs through Data > Get Data but the folder connector availability varies depending on the Excel version.
-
Open a workbook.
-
Go to Data > Get Data.
-
Select From Workbook for each file when the folder connector is unavailable.
-
Import each file into Power Query.
-
Append queries through Home > Append Queries.
-
Load the final appended query into a new worksheet.
Method 3: Merge Sheets Using “Move or Copy”
This method preserves sheet structure.
-
Open the workbook that contains the sheet you want to move.
-
Right-click the sheet tab.
-
Select Move or Copy.
-
Select the target workbook from the dropdown.
-
Pick the position for the sheet.
-
Check Create a copy when you want to keep the sheet in the original file.
-
Select OK.
Method 4: Use VBA for Automated Merging
VBA automates merging for large volumes of files. The following script merges all sheets from all Excel files located in one folder into a single workbook.
Sub MergeFiles()
Dim wb As Workbook
Dim ws As Worksheet
Dim myPath As String
Dim myFile As String
Dim destWB As Workbook
Set destWB = ThisWorkbook
myPath = "C:\YourFolderPath\"
myFile = Dir(myPath & "*.xlsx")
Do While myFile <> ""
Set wb = Workbooks.Open(myPath & myFile)
For Each ws In wb.Sheets
ws.Copy After:=destWB.Sheets(destWB.Sheets.Count)
Next ws
wb.Close SaveChanges:=False
myFile = Dir
Loop
End Sub
Method 5: Merge Files Using the Consolidate Tool
The Consolidate tool works when files share identical headers.
-
Open a new workbook.
-
Go to Data > Consolidate.
-
Select a function such as Sum, Average, or Count.
-
Select Add and choose reference ranges from each source workbook.
-
Mark Top row and Left column for label-based matching.
-
Select OK to consolidate the data.
When should you merge by sheets, and when should you merge by tables?
Merging by sheets is preferred when workbooks have unique layouts that should not change. Merging by tables is preferred when files share identical column structures and represent rows of related data.
Does merging Excel files increase the file size?
Yes. Merging files increases the file size because the new workbook contains the sum of all imported rows, columns, formulas, formats, and objects.
What are the best practices for merging Excel files?
-
Structure column headers consistently to avoid mismatched data.
-
Use Power Query when merging more than three files.
-
Remove blank rows before merging.
-
Keep large datasets in Table format for better structure.
-
Use the same data types across files to avoid import errors.
-
Refresh Power Query connections when new files enter the folder.
Which method is the most accurate for large datasets?
Power Query is the most accurate because it loads structured data, preserves data types, handles millions of rows, and reduces manual errors by 88–95% in repetitive merging tasks.
Which method supports automation?
VBA supports automation because it executes predefined steps without user input. Power Query supports automation through scheduled refreshes for structured folders.
What causes errors when merging Excel files?
-
Inconsistent column names.
-
Mixed data types inside a column.
-
Workbook corruption.
-
Hidden or filtered rows that alter ranges.
-
External links inside sheets being merged.
How to prevent data loss during merging
-
Create a backup of all files before merging.
-
Validate row counts before and after merging.
-
Use structured tables for consistency.
-
Avoid merging files with different header sets.
-
Scan for duplicate rows after merging.
Keywords for Optimization
-
Excel merge files
-
Combine Excel workbooks
-
Append sheets Excel
-
Power Query merge
-
VBA Excel merge
-
Consolidate Excel data
-
Merge tables Excel
Get Online Tutoring or Questions answered by Experts.
You can post a question for a tutor or set up a tutoring session
Answers · 1
How to merge excel files into one file
Answers · 1
How to merge excel files into one
Answers · 1
How to mail merge from excel to email
Answers · 1
How to mail merge from excel to pdf
Answers · 1