How to Merge Multiple Excel Files into One Workbook
Last updated: 2026-05-22 · by xlstools team
Combining multiple Excel files is a routine task for anyone working with monthly reports, multi-region exports, or data from several teams. This guide walks through the two merge modes, when to use each, and the common pitfalls to avoid.
Two ways to merge Excel files
xlstools offers two distinct merge modes. Picking the right one is the most important decision.
1. Merge by sheets (combine workbooks)
Every uploaded file becomes its own tab in the output workbook. Use this when:
- Each file represents a different time period, region, or department
- Files have different column structures that you want to preserve
- You want to keep data segregated but in one file (e.g. for emailing)
2. Merge by rows (consolidate data)
Rows from all files are stacked vertically into a single sheet. Use this when:
- Files have identical column structures (same headers in the same order)
- You want one master dataset for analysis or pivot tables
- Examples: monthly sales exports, daily inventory snapshots, customer lists from multiple sources
Step-by-step walkthrough
Step 1 — Upload your files
Click "Add file" to select 2–20 Excel files. Mixed formats are fine — .xlsx, .xls, and .csv can all be uploaded in the same job. The tool will parse each file and show its sheet count and row count so you can verify before merging.
Step 2 — Choose the merge mode
Pick Merge by sheets or Merge by rows based on the guidance above. The tool will show a preview of what the output structure will look like.
Step 3 — Configure options
Two important toggles:
- Include headers — when merging by rows, only keep the header from the first file (recommended; otherwise every file's header row appears in the middle of your data).
- Add source column — appends a
_source_filecolumn to every row so you can trace which file each record came from. Invaluable for debugging totals that don't reconcile.
Step 4 — Download
The output is a single .xlsx file. Open it in Excel/Numbers/LibreOffice to verify the row count matches the sum of your inputs.
Common use cases
Consolidating monthly financial reports
You have 12 P&L exports, one per month. Use Merge by sheets to create a single workbook with 12 tabs — one per month — preserving each month's specific account breakdown.
Unifying multi-region sales data
You have three regional sales exports (APAC, EMEA, Americas), each with identical columns. Use Merge by rows with Add source column enabled to get one stacked dataset where every row is tagged with its region of origin — perfect input for a pivot table.
Rolling up team headcount sheets
Each department maintains its own roster spreadsheet with the same template. Use Merge by rows to build a company-wide directory in one pass, then sort or filter by department.
Pitfalls and how to avoid them
| Problem | Cause | Fix |
|---|---|---|
| Output row count is less than expected | Some input files have headers that don't match the first file (row mode) | Standardize headers across files before uploading, or use sheet mode |
| Headers appear repeatedly in the middle of the data | "Include headers" disabled with row mode | Enable "Include headers"; only the first file's header is kept |
| Some cells show formulas instead of values | Source files contain formulas referencing other workbooks | Open the source in Excel, "Paste special → values" first, then re-export |
| Output is too large to open in Excel | More than ~1M rows after merge | Use the Split tool afterward to break it into chunks |
When NOT to merge
Sometimes merging is the wrong answer:
- You want to find differences — use the Compare tool instead
- You want to deduplicate after merging — merge first, then run the Dedupe tool
- Files share rows that should be combined into a single richer row (join) — Excel merge does not do joins; use Power Query or a database
Privacy & security
All merging happens locally in your browser via SheetJS. Your files are never uploaded to any server. Even very large workbooks (hundreds of MB) are processed entirely on your device.
Related tools
- Excel Merge Tool — run a merge job now
- Compare Two Excel Files — find what changed instead of stacking
- Dedupe Tool — clean duplicates from your merged file