New Tool Radar

AI for Data & Spreadsheets

How to Merge Two Tables in Excel with Power Query

Merge two Excel tables with Power Query on a shared key so prices join to orders without a fragile VLOOKUP.

Schematic illustration for How to Merge Two Tables in Excel with Power Query: three numbered steps - Load both tables as queries; Home, Merge Queries; Expand only needed columns.

Joining an orders table to a price list by hand means a VLOOKUP in every row, and one wrong column index breaks every price. Power Query merges the two tables on a shared key column, like a database join, and the join can be refreshed when either table changes.

Prerequisites

  • Excel with Power Query
  • Two tables with a shared key column, such as SKU
  • A copy of the source file, so the original stays untouched.

Steps

  1. Turn each table into an Excel Table with Ctrl+T, then load each one with Data, From Table/Range and choose Only Create Connection.
  2. Go to Data, Get Data, Combine Queries, Merge, and pick the two queries and their shared key column.
  3. Choose a left outer join so every order row is kept even if its price is missing.
  4. Expand the merged column and tick only the columns needed, such as price, then check the row count matches the orders table.
  5. Click Close and Load, then spot-check three prices against the price list.

Worked example: Fictional orders merged with a price list

The practice table below is a fictional five-order merge result. Each amount is quantity times the merged unit price, and the total is their sum. The table below is fictional practice material, with fictional values. It is the expected result, worked out by hand, not a run of any tool.

Item Qty Unit price Amount
Order 201, HW-101 2 12.50 25.00
Order 202, HW-102 1 18.75 18.75
Order 203, HW-103 4 9.99 39.96
Order 204, HW-104 2 14.25 28.50
Order 205, HW-105 1 21.00 21.00
Total 133.21

Expected result. Five orders merged, each price matches the price list, and the total is 133.21.

Limits

  • The two key columns must have the same data type, or the merge will match nothing.
  • A left outer join keeps unmatched orders with a blank price, which must be investigated, not ignored.

Sources

See all