The fastest way to merge Excel files depends on what you're combining

If you need to pull data from several Excel files into one, your best route depends on whether the files have the same structure and how often you need to repeat the process. For a one-time merge of files with identical layouts, copying and pasting between files works fine. If the files have different column arrangements or you do this regularly, using Excel's built-in consolidation tools or Power Query saves time and reduces mistakes.

The method you choose also depends on your Excel version. Older versions (2010 and earlier) have fewer automated options than Excel 2016 and newer. All the approaches below work on both Windows and Mac, though some menu locations differ slightly on Mac.

Key Takeaways

  • For files with identical layouts, open all files side by side and copy data directly between them, pasting into a master file.
  • Excel's Data > Consolidate tool combines data from multiple files automatically if they have the same column headers and structure.
  • Power Query (Get & Transform in Excel 2016 and newer) can merge files with different column orders and handles large datasets more efficiently than manual copying.
  • If files are updated regularly, set up a consolidation formula or Power Query connection once so new data pulls in automatically.

Copying and pasting between files when layouts match

This is the simplest approach when you have two or three files with the same columns in the same order. Open all the files you need to merge, then arrange them side by side on your screen. On Windows, use the View tab and select "Arrange All" to tile them. On Mac, use Window > Arrange to position them.

In each source file, select all the data except the header row (click the first data cell, then press Ctrl+Shift+End on Windows or Cmd+Shift+End on Mac to select to the last cell with data). Copy the selection. Switch to your master file and click the first empty cell below your existing data, then paste. Repeat for each file.

This method works well for small files or one-time merges. The downside is that if the source files change later, you have to repeat the entire process manually.

Using Excel's Consolidate tool for structured data

If your files all have the same column headers and row structure, the Consolidate tool automates the process. This works best when you're combining sales data, inventory counts, or other datasets where each file represents the same information from different locations or time periods.

First, create a new blank worksheet in one of your files or in a separate master file. Go to the Data tab and click Consolidate (on Mac, it's under Data > Consolidate). A dialog box opens asking you to specify the data range. Click the folder icon next to "Reference" and navigate to the first source file, then select the entire data range including headers. Click Add. Repeat for each file you want to merge.

Make sure "Use labels" is checked if your data has headers. Choose whether to use labels in the top row, left column, or both. Click OK. Excel combines all the data into your new worksheet. If the source files are updated later, you can refresh the consolidation by going back to Data > Consolidate and clicking the refresh button.

Using Power Query to merge files with different structures

Power Query (called Get & Transform in Excel 2016 and newer) is the most flexible option when files have different column orders or when you need to clean up data during the merge. It also handles large files more efficiently than copying and pasting.

Open a blank Excel file. Go to the Data tab and click Get Data (or Get & Transform Data). Select "From File" and choose "From Folder". Navigate to the folder containing all your source files and click Select Folder. Power Query shows a preview of all files in that folder. Click "Combine & Load" to merge them all at once.

Power Query automatically stacks all files with matching column names. If column names differ between files, you can edit the query to rename columns before combining. Once the merge is complete, the data appears in your worksheet as a table. If you add new files to that folder later, you can refresh the query to include them automatically.

Consolidating data with formulas for ongoing updates

If you merge the same files regularly and they change between merges, setting up formulas is more efficient than repeating manual steps. This approach works when all source files have identical structures and live in the same folder.

In your master file, use a formula like INDIRECT to reference cells in other workbooks. For example, =INDIRECT("[SourceFile1.xlsx]Sheet1!A1") pulls the value from cell A1 in Sheet1 of SourceFile1. Copy this formula down and across to pull all the data you need. When the source files update, your master file updates automatically the next time you open it (Excel may ask for permission to update external links).

This method requires that all source files stay in the same location with the same names. If files move or are renamed, the formulas break. For this reason, it works best in controlled environments where file locations are stable.

Handling files with different column orders

When source files have the same data but columns in different orders, Power Query is your best option because it matches columns by name rather than position. If you prefer not to use Power Query, you can manually reorder columns in each source file to match before merging, then use the Consolidate tool.

Alternatively, create a mapping table in your master file that shows which column in each source file corresponds to which column in your final result. Then use VLOOKUP or INDEX/MATCH formulas to pull data from each source file in the correct order. This takes longer to set up but gives you complete control over how data is arranged.

Removing duplicates after merging

After combining files, you may have duplicate rows if the same record appears in multiple source files. Select all your merged data including headers. Go to the Data tab and click "Remove Duplicates" (on Mac, use Data > Filter > Standard Filter). Choose which columns to check for duplicates — usually you want to check all columns, but sometimes you check only a key column like ID or date. Click OK and Excel removes exact duplicate rows.

If you need to keep one copy of each duplicate but flag which records appeared multiple times, use a helper column with COUNTIF to count how many times each row appears, then filter or sort by that column.

Frequently Asked Questions

Can I merge files that have different numbers of columns?

Yes, but the approach depends on your files. If extra columns in some files contain data you want to keep, Power Query is the best choice because it preserves all columns and fills missing values with blanks. If you only want columns that appear in all files, the Consolidate tool works if you delete the extra columns from source files first.

What if one file is much larger than the others?

Power Query handles large files more efficiently than copying and pasting because it doesn't load the entire file into memory at once. If you're using formulas or the Consolidate tool and the file is very large (over 100,000 rows), consider splitting it into smaller chunks first or switching to Power Query.

Do I need to keep the source files after merging?

If you used Power Query or formulas, keep the source files in their original location because the merged file references them. If you copied and pasted data, you can delete the source files once you've verified the merge is complete and correct. Always keep a backup of original files until you're certain the merge worked.

Can I automate this so it happens on a schedule?

Power Query can refresh automatically when you open the file, but Excel doesn't have a built-in scheduler for unattended updates. If you need truly automated merging on a schedule, you would need to use a third-party tool or write a macro in VBA (Visual Basic for Applications), which requires programming knowledge.

What's the difference between consolidating and merging?

Consolidating typically means combining data from multiple sources and calculating totals or summaries (like adding up sales from different regions). Merging means stacking all rows together without calculation. Excel's Consolidate tool can do both depending on your settings, while Power Query and copy-paste are purely merging operations.