How to Merge CSV Files by a Common Column

Join two files by a shared key — no VLOOKUP, no formulas, nothing that breaks when a column moves.

You have an orders file and a customers file. You need the customer's name, region, and email next to each order. Both files share a customer ID column. In Excel, this is VLOOKUP territory — and VLOOKUP has a well-earned reputation for breaking the moment the underlying data changes.

This guide covers doing that join reproducibly: define it once, re-run it on every new export, and get identical results every time.

Note: if you want to stack multiple files row by row into one table, that is a different operation — see how to combine and append CSV files.

Why VLOOKUP struggles with recurring files

The join model: pick a key, pull the columns

The mental model for key-based merging is simpler than VLOOKUP once you see it:

  1. Open your primary file (e.g. orders.csv).
  2. Add a Merge from another file step and select the secondary file (customers.csv).
  3. Pick the matching columns: orders.CustomerID matches customers.ID.
  4. Choose which columns to pull across: Name, Region, Email.
  5. Decide how to handle non-matches: keep all rows with blanks for unmatched, or keep only matched rows.
It matches like VLOOKUP — the first row per key — so duplicate keys in the secondary file never multiply your row count. Save that as a recipe and re-run it next month in one click. The secondary file is re-read fresh each time, so if it changed, the merge reflects that.

Do it with Kramata

Kramata treats the merge as a step inside a recipe. You build it once on a sample file, save it, and next month load the new export and click once. No formulas, no broken references, and your files never leave your computer.

For a full walkthrough including left vs. inner join behavior and handling unmatched rows, see merge two spreadsheets without VLOOKUP.

Download Kramata free for Windows

Related guides

Merge two spreadsheets without VLOOKUP · Combine and append CSV files without losing data · Merge multiple CSV files into one · A simple Power Query alternative

FAQ

What if the key column has a different name in each file? You pick which column from each file to match on — the names do not need to be identical across files.

What happens to rows with no match? Your choice: keep them with blank values for the pulled columns (a left join), or drop them (an inner join). Both options are set once in the recipe.

Can I match on more than one column? Single-key matching today; multi-key is on the roadmap.

Is this the same as Power Query's Merge Queries? Same idea — a join between two tables on a common key — in plain language, built for non-technical users. No M code required.

Is this different from appending files? Yes. Merging by a column joins two files horizontally — pulling new columns from a second file to match rows in the first. Appending stacks rows from multiple files with the same structure vertically into one table.

What if the secondary file changes next month? Re-running the recipe re-reads the secondary file fresh — so the merge automatically reflects any updates to it.