How to merge two Excel files using a common column
Join two Excel files on a shared column like an ID or email: with XLOOKUP, Power Query, or in your browser with no formulas. Handles missing and duplicate keys.
Look up prices kept on another sheet.
The table range gets the sheet name in front: Prices!$A$2:$C$11. Click the tab while typing.
Find the price of each product in D2:D7, from the price list on the Prices sheet. Write one formula in D2 and fill it down.
Typing formulas is easiest on a computer with a keyboard.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Order | Product | Quantity | Price | |
| 2 | #1657 | Wireless Mouse | 7 | ||
| 3 | #1658 | Bookshelf | 4 | ||
| 4 | #1659 | Filing Cabinet | 8 | ||
| 5 | #1666 | USB-C Hub | 3 | ||
| 6 | #1673 | Desk Organiser | 9 | ||
| 7 | #1676 | Monitor Stand | 4 | ||
| 8 | |||||
| 9 | |||||
| 10 | |||||
| 11 | |||||
| 12 | |||||
| 13 | |||||
| 14 | |||||
| 15 |
Put the sheet name and an exclamation mark in front of the cells: Prices!A2:C11 means cells A2 to C11 on the Prices sheet. A reference without a sheet name always means the sheet the formula is on.
No. While typing the formula, click the sheet's tab at the bottom and select the cells. Excel writes Prices!A2:C11 for you. Press Enter to finish, and you're taken back to the sheet you started on.
Wrap it in single quotes: 'Price List'!A2:C11. Clicking the tab adds the quotes for you.
Filling down moves the cells, even on another sheet: Prices!A2:C11 becomes Prices!A3:C12 one row down. Prices!$A$2:$C$11 stays put. Press F4 while the cursor is on the range.
XLOOKUP work the same way?Yes. Both arrays need the sheet name: =XLOOKUP(B2,Prices!$A$2:$A$11,Prices!$C$2:$C$11). To bring whole columns across from another file, see how to merge two Excel files on a common column.
Join two Excel files on a shared column like an ID or email: with XLOOKUP, Power Query, or in your browser with no formulas. Handles missing and duplicate keys.
Know someone fighting with a spreadsheet? Send them this page.