Skip to content

Merging 4 mismatched Excel files with Claude Code: a hands-on test

One Claude Code prompt merged four branch Excel files, caught the one with reordered and renamed columns, and built a SUMIFS summary in about a minute. Plus the check you still need.

By the RanThis team, written with AI assistance4 min read

Why trust this: every result, number and screenshot comes from a real run on our own accounts, not from the AI. How we test

Claude Code can merge several Excel files into one table with a single prompt, even when one file has its columns in a different order and under different names. We tested it with four branch sales files: about 1 minute 9 seconds later we had a 32-row merged sheet and a formula-driven summary that matched the source files to the last unit.

Hands-on test

The test: four branch files, one of them mismatched

We made four October sales files (sample data, amounts in Vietnamese dong) for four branches. Three share the same columns: Date, Product, Quantity, Revenue. The fourth was deliberately broken the way real branch files usually are: columns in a different order and renamed (Item, Sale date, Sales, Qty). Copy-pasting that by hand is how revenue ends up in the quantity column.

Setup: Claude Code 2.1.301 in a terminal, signed in with a Claude Max plan, in auto mode. Since v2.1.283, auto mode is the default starting permission mode: a second model reviews each action instead of asking you every time.

The only prompt we typed (in Vietnamese, our working language) translates to:

Merge the 4 Excel files in the chi-nhanh folder into tong-hop.xlsx: one combined table with an added Branch column, and a sheet with total revenue per branch. Don't ask follow-up questions.

Real Claude Code session: ls shows four branch Excel files, then the merge prompt, and Claude loading the xlsx skill on its own

Claude loaded Anthropic's xlsx skill by itself; we never named it.

Claude caught the mismatched file

Before merging, Claude read the header row of every file and said so on screen:

Claude's status line mid-task: the Da Nang file has a different column order and different column names, so it will map the columns before merging and convert text dates into real dates

Two things it did without being told:

  • Mapped the mismatched columns to the standard names before merging.
  • Converted text dates ("02/10/2026") into real date values so the sheet can be sorted and filtered.

The result

The folder now had tong-hop.xlsx with two sheets:

  • Combined data: 32 rows from the 4 files, a Branch column, sorted by date, with filters and a frozen header row.
  • Totals by branch: transactions, quantity, revenue and share. Every cell is a COUNTIFS/SUMIFS formula pointing at the combined sheet, so edits flow through.
The Totals by branch sheet from the file Claude created, opened in LibreOffice: four branches, 32 transactions, 117,600,000 total

We checked it against the source files ourselves: 9 + 7 + 10 + 6 = 32 rows, 117,600,000 in total, a match. The mismatched branch came out right too: 28,850,000 and 19 units, same as its source file.

Where it fell short

The catch: its warning was incomplete

Claude added a helpful-sounding note: one branch had 4 transactions dated after "today" (October 16). True, but incomplete. The merged sheet shows 12 more future-dated rows across the other three branches (6, 5 and 1). Our sample data spreads dates across the whole month, so nothing was actually wrong, but the lesson stands: an AI's warnings are not a substitute for your own check.

Our 30-second check after every merge:

  1. Row count of the merged sheet equals the sum of the source row counts.
  2. Sum one money column in the sources and compare it with the total row.
  3. Spot-check a few rows from any file that had a different structure.

Try it yourself

  1. Install Claude Code and sign in with a paid Claude plan (the Free plan doesn't include Claude Code).
  2. Put the files in their own folder, open a terminal there and run claude.
  3. Describe the output file, the extra column and the summary you want in one prompt.
  4. Run the three checks above before you send the numbers to anyone.

FAQ

Can Claude Code merge Excel files with different column layouts?

Yes. In our test it read every header row, noticed one file had reordered and renamed columns, and mapped them to the standard names before merging. The totals matched the source files.

How long does it take?

For four small files (32 rows in total) it took about 1 minute 9 seconds from prompt to finished file, including reading the files, building the summary and recalculating the formulas.

Does the summary use formulas or pasted values?

Formulas. The per-branch sheet uses COUNTIFS and SUMIFS on the combined sheet, so it updates when the data changes.

Do I still need to check the result?

Yes. Claude flagged future-dated rows in one branch but missed 12 similar rows in the other three. Count rows, sum a money column and spot-check the odd file before you rely on the numbers.