Merge CSV Files into Excel: 4 Proven Ways to Combine Them

Merge CSV files into one Excel workbook with 4 proven methods: copy-paste, command line, Python pandas, and Power Query append. Full walkthrough inside.

Twelve monthly exports sitting in a folder, one per region, or a fresh CSV every day — and you need them as one Excel workbook. Learning to merge CSV files into Excel properly saves hours of copy-paste drudgery and eliminates the mismatched-column mistakes that creep in when you do it by hand.

This guide shows four reliable ways to combine CSV files into one Excel workbook: Power Query’s Append feature (the no-code pro method that stays refreshable), Python with pandas (the most flexible option for messy real-world files), the command line (the fastest for simple same-structure files), and plain copy-paste (fine for a handful of small files). You will also learn the critical prep step most tutorials skip — verifying your files actually match before merging — plus how to handle different columns, remove duplicates, and decide between one combined sheet or multiple sheets.

Whether you are consolidating sales reports from offices across the US, UK, India, Canada, and Australia, or stitching together daily downloads into a yearly dataset, you will find a method below that fits. And when your merged result is ready, our free CSV to Excel converter handles any final format touch-ups in your browser.

Why Merge CSV Files into One Excel Workbook?

Fragmented data is analysis-hostile. Twelve monthly CSVs mean twelve separate pivot tables, twelve charts to update, and no easy way to answer “how did Q3 compare to Q1?” Merging them into one workbook — either as a single combined sheet or as twelve sheets in one file — turns scattered exports into something you can actually analyze: one pivot table across the whole year, one set of filters, one file to share with your manager.

The two merge shapes serve different needs. Appending stacks rows from all files into one tall sheet — right when every file has the same columns (twelve months of identical sales exports). Combining as sheets keeps each file on its own tab — better when files have different structures or when you want to preserve each source separately while keeping one shareable file. This guide covers both, starting with the prep work that makes either one succeed.

Three spreadsheet puzzle pieces interlocking to form one complete Excel sheet
Merging combines scattered CSV files into a single Excel workbook you can actually analyze.

Before You Merge: Make Sure Your Files Match

Ninety percent of merge disasters come from skipping this step. Before combining anything, verify these five things across all your files:

  1. Same columns, same order, same names. Open two files side by side. Is it “CustomerID” in one and “customer_id” in another? Rename first — Power Query and pandas match columns by name, and near-matches become separate columns full of blanks.
  2. Same delimiter. A comma-delimited file merged with a semicolon-delimited file produces garbage. Check with a text editor; fix stragglers with our delimiter guide before merging.
  3. Same encoding. Mixed UTF-8 and Windows-1252 files corrupt special characters on merge. Standardize to UTF-8 first.
  4. Same date and number formats. US-style MM/DD/YYYY dates mixed with UK-style DD/MM/YYYY dates will silently misinterpret half your data. Normalize during the merge with explicit parsing.
  5. Headers present in every file (or none). Decide which it is. Most merge methods expect a header row in each file and keep only the first one.

A quick pandas check prints every file’s columns so mismatches jump out:

import pandas as pd
from pathlib import Path

for f in sorted(Path("monthly").glob("*.csv")):
    cols = pd.read_csv(f, nrows=0).columns.tolist()
    print(f.name, "->", cols)

Fix the mismatches now — renaming a column takes seconds, untangling a merged mess takes hours. Pay special attention to near-duplicate names that differ only by case, spacing, or underscores (“Customer ID” vs “customer_id” vs “CustomerID”): to a human they are obviously the same column, but to Power Query and pandas they are three different columns, and your merged sheet will sprout triplets of half-empty columns. A quick normalization pass — lowercase everything, replace spaces with underscores — prevents the entire class of problem. The same applies to value formats: “1,234.56” in one file and “1234.56” in another will import as text in one and number in the other, so standardize those too before you merge rather than after.

Several CSV documents stacking together and merging into one Excel workbook with multiple sheet tabs
Files that share the same columns merge cleanly; mismatched files need prep work first.

Merge CSV Files into Excel with Power Query

Power Query is the best no-code way to merge CSV files into Excel, and its killer feature is refreshability: when next month’s file arrives, you drop it in the folder and hit Refresh instead of rebuilding everything. There are two approaches — folder combine (automatic) and manual append (controlled).

Method A: Combine from a folder (automatic)

  1. Put all your CSVs in one folder — nothing else in there.
  2. In Excel: Data > Get Data > From File > From Folder, and select the folder.
  3. In the preview, click Combine > Combine & Transform Data.
  4. Pick the sample file and confirm the delimiter. Power Query appends every CSV in the folder into one table.
  5. Clean as needed (fix types, remove columns), then Close & Load to a worksheet.

From now on, adding a file to the folder and clicking Data > Refresh All updates the workbook. This is the ideal setup for recurring reports — the monthly sales pack that rebuilds itself.

Method B: Append specific queries (controlled)

When you need to merge selected files rather than a whole folder:

  1. Import each CSV with Data > Get Data > From Text/CSV, but choose Transform Data and then Close & Load To… > Only Create Connection for each.
  2. Go to Data > Get Data > Combine Queries > Append.
  3. Add the queries to append (choose “Three or more tables” for several files).
  4. Load the appended query to a worksheet.

Behind the scenes, Power Query writes M code like Table.Combine({Sales_Jan, Sales_Feb, Sales_Mar}). Columns that exist in only some tables get nulls in the others — usually what you want, but rename mismatched columns first for a clean result. For the full Power Query toolkit, see our Power Query import guide.

Three separate data tables stacking vertically into one tall unified table
Appending stacks rows from many CSVs into one tall sheet — Power Query’s Append does this with a refreshable query.

Merge CSV Files with Python (Pandas Concat)

When files are messy — different columns, different encodings, millions of rows — Python is the most capable way to merge CSV files into Excel. The core operation is concat:

import pandas as pd
from pathlib import Path

files = sorted(Path("monthly").glob("*.csv"))
frames = [pd.read_csv(f) for f in files]

merged = pd.concat(frames, ignore_index=True)  # stacks rows, aligns columns
merged.to_excel("merged_2026.xlsx", index=False)
print(f"Merged {len(files)} files -> {len(merged):,} rows")

ignore_index=True rebuilds a clean row index instead of repeating 0…n for each file. By default, concat uses an outer join on columns: files with different columns merge anyway, with blanks where a file lacked a column — far more forgiving than the command-line method below.

Handling real-world mess

Production files are rarely clean. This hardened version skips bad rows, normalizes encodings, and records which file each row came from (invaluable for tracing errors back to the source):

import pandas as pd
from pathlib import Path

frames = []
for f in sorted(Path("monthly").glob("*.csv")):
    try:
        df = pd.read_csv(f, encoding="utf-8", on_bad_lines="skip")
    except UnicodeDecodeError:
        df = pd.read_csv(f, encoding="cp1252", on_bad_lines="skip")
    df["source_file"] = f.name  # trace every row to its origin
    frames.append(df)

merged = pd.concat(frames, ignore_index=True)
merged.to_excel("merged_2026.xlsx", index=False)
print(f"Merged {len(frames)} files -> {len(merged):,} rows, {merged.shape[1]} columns")

One file per sheet instead

To merge CSV files into one workbook while keeping each on its own sheet:

import pandas as pd
from pathlib import Path

with pd.ExcelWriter("all_months.xlsx", engine="openpyxl") as writer:
    for f in sorted(Path("monthly").glob("*.csv")):
        sheet = f.stem[:31]  # Excel's 31-char sheet name limit
        pd.read_csv(f).to_excel(writer, sheet_name=sheet, index=False)

For more multi-sheet techniques, read our multiple-sheets guide; for the full Python reference, the Python conversion guide.

Data rows being lifted from several small spreadsheets and pasted into one large master spreadsheet
Python’s concat stacks rows and aligns columns — even when files don’t perfectly match.

Merge CSV Files with the Command Line

For simple same-structure CSVs, the command line merges files in seconds with zero setup. The classic Windows approach uses copy:

REM keep the header from the first file, then append the rest without headers
copy jan.csv merged.csv
for %f in (feb.csv mar.csv apr.csv) do @more +1 "%f" >> merged.csv

The more +1 trick skips the first line (header) of each subsequent file, so the merged CSV has exactly one header row. On macOS/Linux, the equivalent is:

head -1 jan.csv > merged.csv
for f in feb.csv mar.csv apr.csv; do tail -n +2 "$f" >> merged.csv; done

Then convert merged.csv with our free converter. For a more robust command-line merge that understands CSV quoting, csvstack from csvkit is the better tool:

pip install csvkit
csvstack jan.csv feb.csv mar.csv > merged.csv

csvstack aligns columns by name (not position), handles quoted fields correctly, and works across encodings — the command-line merge to reach for when files are not perfectly uniform. Windows users without csvkit can do the same job in PowerShell: Get-Content jan.csv | Set-Content merged.csv for the first file, then Get-Content feb.csv | Select-Object -Skip 1 | Add-Content merged.csv for each subsequent file, which skips each extra header. Caveat for all command-line methods: they are dumb about the 1,048,576 row limit, so check the merged row count with wc -l (or (Get-Content merged.csv | Measure-Object -Line).Lines in PowerShell) before opening in Excel.

A terminal window merging multiple CSV files into one combined spreadsheet
The command line merges simple same-structure CSVs in seconds — csvstack handles the tricky ones.

The Copy-Paste Method (Small Files Only)

For two or three small files, honest copy-paste is perfectly fine and needs no tools:

  1. Open the first CSV in Excel and copy its header row mental note — this defines your column order.
  2. Open the second CSV, select all data rows below its header (click row 2’s number, then Ctrl+Shift+Down), copy.
  3. Paste at the first empty row beneath the first file’s data.
  4. Repeat for each file, then save the workbook as XLSX.

Rules that prevent disasters: never copy the header rows of files 2..n (duplicate headers mid-data break filters and pivot tables), and verify column order matches before each paste — if file 2 has “Amount” and “Date” swapped relative to file 1, fix it first. Beyond about five files or 100,000 rows total, switch to Power Query or Python; manual pasting does not scale and the error rate climbs with every file.

One Sheet or Multiple Sheets?

Choose one combined sheet when the files share the same structure and you want unified analysis — one pivot table, one chart, one filter set across everything. This is the right shape for twelve months of sales, daily logs, or regional exports you intend to compare.

Choose multiple sheets when the files have different structures, when each source must stay identifiable for audit, or when the combined row count would exceed 1,048,576 rows. A workbook with twelve monthly tabs plus a summary sheet is a classic finance pack. You can still analyze across sheets with 3D references or Power Query appends later.

And if the merged result blows past the row limit entirely, do not force it — load the appended data into the Data Model (Power Query guide) or keep the split-file approach from our large CSV guide.

Whichever shape you choose, consider adding a cover sheet to the finished workbook: the merge date, the list of source files, the total row count, and any filters or assumptions you applied. Six months from now — or when a colleague inherits the file — that cover sheet is the difference between a trusted dataset and a mystery file nobody dares to touch. In Python, write it with a second to_excel call using startrow offsets or a separate sheet; in Power Query, add it as a static table after loading.

A funnel collecting many small spreadsheet sheets and pouring out one complete Excel workbook
Many files in, one workbook out — choose a single appended sheet or one sheet per file.

Validate the Merged Result

A merge is only done when you have proven it is complete and correct. Run these three checks every time, whether you merged with Power Query, Python, or the command line.

1. Row counts must add up

The merged row count should equal the sum of the source row counts (minus the duplicate headers you correctly excluded). In Python:

import pandas as pd
from pathlib import Path

expected = sum(sum(1 for _ in open(f)) - 1 for f in Path("monthly").glob("*.csv"))
merged = pd.read_excel("merged_2026.xlsx")
print(f"Expected: {expected:,} | Merged: {len(merged):,}")
assert expected == len(merged), "Row count mismatch!"

In Excel, compare =ROWS() counts per source against the merged sheet. A shortfall usually means a file was skipped (wrong folder, filtered out) or rows were dropped as errors — Power Query’s error handling can silently remove rows if you told it to.

2. Spot-check the seams

Errors cluster at file boundaries: the last rows of January and the first rows of February. Sort by date and eyeball a dozen rows around each boundary. If you added a source_file column during a Python merge, pivot on it to confirm every file contributed its expected share.

3. Check types and totals

Sum a numeric column per source file and compare against the merged total — a mismatch reveals type problems (numbers imported as text in one file get excluded from sums). Likewise, check date ranges: the merged min/max dates should span all files. These checks take two minutes and catch the silent corruption that ruins analyses weeks later.

Troubleshooting Merge Problems

Duplicate header rows scattered through the data

The classic copy-paste and copy-command mistake: headers from files 2..n sitting in the middle of your data. They break sorting, filtering, and pivot tables. Fix: filter the first column for the header text (e.g. “OrderID”) and delete those rows, then re-merge properly keeping one header.

Columns misaligned after merging

File 1 has columns A,B,C and file 2 has A,C,B — position-based merging scrambles everything. Prevention (the prep step) beats cure, but pandas concat and csvstack align by column name and rescue you even now. Re-run the merge with one of them.

Weird characters after combining files

Mixed encodings: one file’s UTF-8 smart quotes become mojibake next to another file’s Windows-1252 text. Standardize every file to UTF-8 before merging — the Python script above tries UTF-8 first and falls back to cp1252 per file.

Merged file exceeds Excel’s row limit

Twelve 100,000-row files merge into 1.2 million rows — over the 1,048,576 cap. Excel will truncate on open. Split the output across sheets, or load via Power Query into the Data Model.

Duplicates doubled your row count

Overlapping date ranges between files (January’s file also contains late-December rows) create duplicates. After merging, run Data > Remove Duplicates in Excel, drop_duplicates() in pandas, or the Remove Duplicates step in Power Query — choosing the columns that define uniqueness first.

Merges fail in creative ways — ragged rows, BOM headers, locale number formats — so if yours is misbehaving, join the discussion in our community forum with a sample of your files; someone will spot the mismatch in minutes.

Frequently Asked Questions

How do I merge multiple CSV files into one Excel file?

The best methods are Power Query’s Append Queries (no code, refreshable), Python with pandas concat (handles mismatched columns and large files), or the command-line copy command for simple same-structure CSVs. All three are covered step by step in this guide.

Can I combine CSV files into one Excel sheet?

Yes. Stacking rows from many CSVs into a single sheet is called appending, and it works when the files share the same columns. Power Query Append Queries and pandas concat both do this, repeating the header only once at the top.

What if my CSV files have different columns?

pandas concat with its default outer join merges them anyway, filling missing values with blanks. In Power Query, appending queries with different columns also works — unmatched columns get null values. Align column names first for the cleanest result.

How do I merge CSV files without duplicates?

After merging, remove duplicates: in pandas use drop_duplicates(), in Power Query use Remove Duplicates on the Home tab, or in Excel use Data > Remove Duplicates. Decide which columns define a duplicate (order ID? email?) before you run it.

Can Power Query merge CSV files automatically?

Yes. Put all CSVs in one folder, use Data > Get Data > From Folder, combine the files, and Power Query appends them into one table. When new files arrive, just refresh the query — the merge rebuilds itself.

Is there a limit to how many CSV files I can merge?

The practical limit is Excel’s 1,048,576 row ceiling for a single sheet. If the merged result exceeds it, merge into multiple sheets (one per file) with ExcelWriter, or load the appended data into the Data Model instead of the grid.

CE
csvtoexcel.site team

We build free, private, browser-based file tools. Every guide is written and tested by our editors.