The process of combining data stored in two or more separate Excel workbooks so it can be analyzed in a single, unified PivotTable.
Excel’s PivotTable engine is one of the quickest ways to summarize large, tabular data sets. However, in most business environments the data you need lives in more than one workbook—monthly sales files, region-specific exports, or departmental trackers maintained by different users. Consolidating those workbooks into one PivotTable lets you analyze the total picture without manually copying sheets together every reporting cycle.
Keeping source workbooks separate permits decentralized ownership and lightweight file sizes, yet senior stakeholders still expect unified reporting. Consolidation brings these benefits:
Available in Excel 2016+ (and 2010/2013 with the free add-in), Power Query provides a GUI to import and append any number of workbooks or CSVs, apply data-quality steps, and load the result directly to a PivotTable or the Data Model. It is the modern, fully supported method and handles millions of rows.
This hidden wizard predates Power Query. It can combine identical range layouts across workbooks but lacks transformation capabilities and often bloats file size. Only use if you’re stuck on pre-Power Query versions of Excel.
Macro code can open each workbook, copy data into a master table, and refresh a PivotTable. VBA is powerful for highly customized scenarios but has steeper maintenance overhead.
\\Finance\Sales\MonthlyExports
) and place only the input workbooks there.Remove non-Excel files, exclude obsolete versions, or filter by naming pattern (File.Name
ends with .xlsx
and contains 2024
, for example).
Transform Sample File
query, you can: With the unified table now in memory, drag fields onto Rows, Columns, and Values to analyze totals by region, product, month, etc. If you loaded to the Data Model you can add DAX measures for more advanced calculations.
Excel still ships an older wizard that can stitch ranges together without Power Query. To access:
Alt + D + P
), select Multiple consolidation ranges, point to each workbook’s range, and finish.Limitations: cannot clean columns, no automatic refresh when new files appear, and results often include extra “Row”/“Column” fields you must hide.
Column1, Column2
field names. Fix: In the sample-file query, use Home → Use First Row as Headers.If you need to transform legacy workbooks or schedule consolidation from Windows Task Scheduler, a macro can help. Below is a minimal pattern:
Sub ConsolidateWorkbooks()
Dim wb As Workbook, wsDest As Worksheet, LastRow As Long
Const SourcePath As String = "C:\Data\Regional\"
Application.ScreenUpdating = False
Set wsDest = ThisWorkbook.Sheets("MasterData")
wsDest.Cells.Clear
LastRow = 2 'assumes header in row 1
'loop through xlsx files in folder
Dim fname As String: fname = Dir(SourcePath & "*.xlsx")
Do While fname <> ""
Set wb = Workbooks.Open(SourcePath & fname, ReadOnly:=True)
With wb.Sheets(1)
.UsedRange.Offset(1).Copy wsDest.Cells(LastRow, 1)
LastRow = LastRow + .UsedRange.Rows.Count - 1
End With
wb.Close False
fname = Dir
Loop
'refresh pivot
ThisWorkbook.PivotTables(1).PivotCache.Refresh
Application.ScreenUpdating = True
End Sub
This macro empties a MasterData
sheet, copies all rows from every workbook in a folder, and refreshes the first PivotTable. Extend it with error handling, schema checks, or scheduled execution as needed.
Date modified
> LastRefreshDate and append only new rows.Excel’s Power Query makes workbook consolidation repeatable and nearly maintenance-free. Invest time in clean, consistent source data, load to the Data Model for scale, and document your transformation steps. Your future self—and your stakeholders—will thank you.
Data engineers and analysts frequently receive data split across separate Excel files—by month, region, or department. Manual copy-paste is error-prone, slow, and unscalable. Automating consolidation with Power Query or VBA creates a durable, refreshable pipeline that keeps analytic models and dashboards accurate while respecting workbook ownership boundaries.
Yes. Power Query’s append operation is position-based; mismatched headers create duplicate columns. Standardize names in source files or rename columns in the sample query before combining.
Absolutely. Store the workbook in OneDrive/SharePoint and enable Data → Queries and Connections → Properties → Refresh on open. For VBA solutions, call ActiveWorkbook.RefreshAll
in Workbook_Open
.
Load the query to the Data Model instead of a worksheet. The VertiPaq engine compresses columns and supports millions of rows—even on a standard laptop.
While Galaxy is focused on SQL rather than Excel, many teams run the consolidation in SQL first (inside a data warehouse) and then use Excel just for lightweight visuals. Galaxy’s AI-assisted SQL editor can write and optimize those consolidation queries before exporting to Excel.