How to Merge Data from Two Tables in Excel
Two tables' data need to be combined into one. The key is to first examine the structure of both tables: if the columns are the same, append them vertically; if the rows correspond one-to-one, place them side by side. This article explains how to make the judgment, the steps to take, and how to verify the result after merging.
Key points of this article
- If the two tables have identical column names and order but different records, stack them vertically (append); if rows correspond one-to-one, place them side by side.
- Before merging, unify the column names, and check whether numbers and dates are stored as text; otherwise, summing will produce errors.
- Keep the original files before merging, so you can roll back if pasting goes wrong, without having to redo the work.
- After merging, verify using two methods, row count and subtotals of each sub-table; this is far more reliable than just glancing at the result.
- Merging by key fields such as name is a matching problem, which is different from simple concatenation.
Many people have two spreadsheets on hand: one with January's sales details and another with February's, or one with basic employee information and another with the corresponding attendance data. To calculate full-year totals or make comparisons, you need to put them into the same table. This kind of operation is very common in Excel, but simply copying and pasting easily leads to misaligned data, and the merged figures may not match.
This article is for people who need to merge the data of two tables. It focuses on two scenarios: stacking tables with the same structure vertically, and placing tables with the same number of rows side by side. Merges that match records by key fields such as name are not covered here. After reading, you will be able to decide which method to use, complete the merge step by step, and check whether the result is correct in a simple way.
How do you merge two tables? One-sentence conclusion
If the structures are the same, append them top to bottom; if the rows correspond one-to-one, place them side by side. For other cases, consider more complex methods. The table below can help you decide quickly.
| Your situation | Recommended Practices | Cause |
|---|---|---|
| Column names and order match, but the records differ (e.g., January and February sales). | Add above and below | Adding rows: the number of columns stays the same, and the operation is simple. |
| Same number of lines, with each line corresponding to the same object (such as two types of information about the same group of people) | Side by side | Column concatenation, provided the two tables have the same row order |
| The column structure differs, or the source table is updated periodically. | Power Query Add-in | Columns can be aligned by column name; simply refresh after the source data is updated. |
| The table comes from a PDF. | Export to Excel first, then merge. | The content needs to be turned into a table first before it can be processed using the method above. |
Before You Begin: Confirm These Points First
Spending two minutes checking before you start can prevent most rework.
- Whether column names and meanings match. When appending rows one below another, the same column must mean the same thing. "Sales Amount" and "Sales Value" are two separate columns in Excel; after merging, blank columns will appear, so unify the names first.
- Whether row order can be relied on. Placing tables side by side depends entirely on row sequence. If one of the tables has been sorted, the same row in the two tables may no longer refer to the same record.
- Whether numbers and dates are stored as text. A small green triangle in the upper-left corner of a cell, or numbers aligned to the left by default, usually indicates text. Text-formatted numbers are excluded from sums, so the totals after merging will be too low.
- Whether headers and blank rows are clean. Merged cells in the header and blank rows in the middle of the data will interfere with appending and with later filtering.
- Whether the original file is kept. Save a copy of the original tables before merging. If something is pasted in the wrong place, you can simply go back to the original and start over.
Steps to Append Two Tables Vertically in Excel
Using two sales tables with the same structure as an example, append the February data to the end of the January table.
- Open the two spreadsheets and decide which one will be the master table (usually the one with more records, or the one you will keep using later, such as the January sales table).
- Switch to the other table, select the data area without the header row, and copy it.
- Switch back to the master table, find the last record, and move to the first cell of the row directly below it.
- Paste.
- Check the area just above the pasted data to confirm there are no blank rows between the two sections, and that the columns line up one-to-one.
- If you need to distinguish the source, add a new column titled "Month" to the right of the master table, and fill in 1 for the first data set and 2 for the second.
- Save as a new file, for example "Merged Sales Version," so that the two original tables are preserved.
The side-by-side approach works similarly: confirm that the two tables have the same number of rows and the same row order, then copy the data area of the second table into the blank columns to the right of the main table, starting at the first row. Try to avoid duplicate column names between the two tables, otherwise they will be hard to tell apart later.
📊 Core Comparison
| Method | Manipulated variable | Suitable situations | Need to pay attention |
|---|---|---|---|
| Copy, paste, append | Small | One-time merge, the data volume is not large | Manual operation: verify after pasting. |
| Copy and paste side by side | Small | Same number of lines, same line order | After sorting any table, the results end up misaligned. |
| Power Query Add-in | Chinese Character Support | The column structure is not fully consistent, or it needs to be refreshed periodically. | The initial setup takes a bit of time, but it can be reused afterward. |
When the data is small and you only need to do it once, copy and paste directly. When you need to repeatedly merge tables with the same structure, set up Power Query once; afterward, you only need to update the source data and refresh the results.
Verify each item after completion
After the merge is complete, don't hand it over directly. Go through it item by item using the checklist below.
| Checklist items | How do you see it? | What should I do if I have a problem? |
|---|---|---|
| Line count | After merging, the number of data rows should equal the sum of the data rows in the two tables (excluding the header). | The line count dropped means a paste was missed; the line count grew means something was pasted twice. Undo, then redo. |
| Column alignment | Randomly spot-check a few rows, comparing each column against the original table. | The misalignment is mostly due to different column orders. Adjust the order and then merge. |
| Total value | Sum the numeric columns of the two original tables separately, then compare them with the totals of the merged table. | The results are usually too small because the numbers are stored as text. Select them, then convert them using the Text to Columns feature or by multiplying by 1. |
| Table headers and blank lines | Check whether there are blank rows between the two blocks of data, and whether the header row was pasted in twice. | Delete redundant table headers and blank lines. |
| Source data quality | If the original table comes from a scanned document, select a section of text and see whether it can be selected. | It cannot be selected, which indicates it is an image; OCR must be performed first, and each number must be checked item by item, as the recognition results may contain errors. |
❓ Frequently Asked Questions (FAQ)
1. Can two tables with differently ordered columns be merged directly?
It is not recommended to paste directly, as this will cause misalignment and the data will end up in the wrong columns. First, adjust the columns of one of the tables to match the other, or use Power Query to append by column name.
2. Why is the sum of numbers incorrect after merging?
A common cause is that numbers are stored as text, so they are ignored when summing. In addition, spaces before or after the numbers can cause the same problem; you can remove the spaces first, then convert the format.
3. How do I merge tables in a PDF?
First, use the export feature of your PDF editor to export the table as an Excel file, then merge it following the steps above. If the PDF is a scanned document, you need to run OCR first. After exporting, check the numbers item by item, because the recognition results may contain errors.
4. How do I merge two tables by matching names?
Matching records by name is a lookup-type problem, which this article won't go into. In simple cases, you can sort both tables by name and then line them up side by side, but first make sure the names are unique; otherwise you may match the wrong people.
📝 Summary
Merge the data from two tables: first determine the structure. If the columns are the same, stack them vertically (append rows); if the rows correspond one-to-one, place them side by side (join horizontally). Before merging, standardize the column names and data formats; after merging, verify using the row count and the subtotals of the separate tables. Doing it in this order generally keeps table data merging error-free.


