How to Merge Excel Files: Methods, Tools, and What to Consider

Combining data from multiple Excel workbooks is one of the most common spreadsheet tasks in any office environment — and one of the most misunderstood. "Merging" can mean several different things depending on what you're actually trying to do, and the right approach depends heavily on your data structure, Excel version, and how you intend to use the result.

What "Merging Excel Files" Actually Means

Before picking a method, it helps to clarify what kind of merge you need:

  • Consolidating sheets into one workbook — moving or copying tabs from multiple .xlsx files into a single file
  • Stacking rows from multiple files — appending data tables on top of each other (e.g., monthly sales reports into one annual dataset)
  • Combining columns side by side — joining related records from two files using a shared key (similar to a database JOIN)
  • Aggregating values — summing or averaging data from matching cells across files

Each of these requires a different tool or technique. Treating them as the same problem is where most merge attempts go wrong.

Method 1: Move or Copy Sheets Manually

For the simplest case — gathering worksheets from different workbooks into one — Excel's built-in Move or Copy feature works without any formulas or add-ons.

  1. Open all source workbooks
  2. Right-click any sheet tab in a source file
  3. Select Move or Copy
  4. Choose the destination workbook from the dropdown
  5. Check Create a copy if you want to preserve the original

This works well when each file has a consistent structure and you just need the sheets in one place. It becomes tedious with more than five or six files and doesn't automate anything — each sheet requires manual steps.

Method 2: Power Query (Get & Transform Data) 🔄

Power Query is the most capable built-in tool for merging Excel files at scale. It's available in Excel 2016 and later (including Microsoft 365) under the Data tab as Get & Transform Data.

With Power Query, you can:

  • Point Excel to a folder containing multiple .xlsx files
  • Automatically combine all files that share the same column structure
  • Append (stack) tables from each file into one master table
  • Refresh the combined data with one click when source files update

The key requirement: all source files must have matching column headers. If one file calls a column "Customer Name" and another calls it "client_name," Power Query will treat them as separate columns rather than merging them.

Power Query also handles Merge Queries, which is its equivalent of a VLOOKUP or JOIN — matching rows between two tables based on a shared column like an ID number or email address.

When Power Query Makes Sense

ScenarioGood Fit for Power Query?
Dozens of files with identical structure✅ Yes
Monthly reports combined into one dataset✅ Yes
One-time merge of two small files⚠️ Overkill
Files with inconsistent column names❌ Needs cleanup first
Excel 2013 or earlier❌ Not natively available

Method 3: VLOOKUP, INDEX/MATCH, or XLOOKUP

When you need to pull specific columns from one file into another based on a matching value — rather than stacking entire datasets — lookup formulas are the traditional approach.

  • VLOOKUP searches a column and returns a value from the same row in an adjacent column
  • INDEX/MATCH is more flexible and works left-to-right or right-to-left
  • XLOOKUP (available in Microsoft 365 and Excel 2021+) is the modern replacement — cleaner syntax, handles missing values more gracefully

These formulas reference external workbooks, meaning both files typically need to be open for the links to update reliably. When the source file is closed, Excel stores the last-calculated value but won't refresh automatically without reopening it.

Method 4: VBA Macros

For users comfortable with basic scripting, a VBA macro can loop through a folder of workbooks and copy data into a master sheet automatically. This approach is highly customizable — you can filter which sheets to include, skip headers after the first file, and handle naming variations.

The tradeoff is maintenance: macros are brittle when file structures change, and they require macro-enabled workbooks (.xlsm), which some organizations restrict for security reasons.

Method 5: Third-Party Tools and Python

Outside of Excel itself, tools like Python with the pandas library handle large-scale file merging more reliably than any spreadsheet method. A few lines of code can merge hundreds of files, handle mismatched columns, and export a clean combined file.

For non-coders, dedicated tools and online services exist specifically for merging Excel files — though these vary widely in how they handle formatting, formulas, and data types. 🛠️

The Variables That Determine Which Method Works for You

No single method suits every situation. What matters most:

  • Volume of files — two files vs. fifty files changes the calculus entirely
  • Data structure consistency — identical columns simplify everything; variation complicates it
  • Excel version — Power Query availability, XLOOKUP support, and performance differ across versions
  • Whether you need it to repeat — a one-time merge vs. a monthly process points toward different tools
  • Formula vs. flat data output — some methods create live links that break if files move; others produce static values
  • Technical comfort level — the most powerful options (VBA, Python) carry a steeper learning curve

A user merging two quarterly reports once has almost nothing in common with a data analyst combining 80 regional spreadsheets every month. Both are "merging Excel files," but the right method, effort level, and potential failure points are completely different.

Understanding your own data — how it's structured, how often the task repeats, and what the output needs to look like — is what separates a clean merge from a frustrating one. 📊