Skip to main content

Power Query: Compare two tables in Excel

Author: Xiaoyang Last Modified: 2022-12-08

Comparing two tables is a common task in Excel. You may want to identify items that are the same, different, or missing from the columns. For example, we have two similar tables with the same column names, but, there are some differences between the two tables. Now, you want to find the differences for comparing each row of the two tables as below screenshots shown. This tutorial will introduce how to use the Power Query feature to deal with this task in Excel.

Compare two tables in Power Query

Please follow the step-by-step tutorial to achieve this job:

Creating queries from the two tables

1. Select the first table that you want to compare, then, in Excel 2019 and Excel 365, click Data > From Table/Range, see screenshot:

Note: In Excel 2016 and Excel 2021, click Data > From Table, see screenshot:

2. Then, in the opened Power Query Editor window, click Close & Load > Close & Load To, see screenshot:

3. In the following Import Data dialog box, select Only Create Connection option, and then, click OK button to close the dialog. see screenshot:

4. Repeat the same step 1- 3 to create a connection for the second table. Finally, you should have two queries corresponding with your tables. And you can see the two tables in the Queries & Connections pane. See screenshot:

Joining queries to compare two tables

After creating queries from the two tables, next, you should join the queries into a new table.

5. Please go on clicking Data > Get Data > Combine Queries > Merge in Excel 2019 and Excel 365, see screenshot:

Note: In Excel 2016 and Excel 2021, click Data > New Query > Combine Queries > Merge, see screenshot:

6. In the popped-out Merge dialog box, please do the following operations:

  • Select the first and second table names from the drop down list separately.
  • Select the columns that you want to compare from the two tables. (To select multiple columns, please press Ctrl key to select them one by one) In this example, I will select all columns to compare.
  • And then, select Full Outer (all rows from both) under the Join Kind drop down.
  • At last, click OK button.

7. Then, a new column for the second table is inserted next to the first table:

  • Click the Expand icon next to the column title.
  • Check Expand option.
  • Check the columns that you want to insert into the comparison table.
  • Finally, click OK button.

8. Then, the data of the second table is populated at once. And now, please click Home > Close & Load > Close & Load to load the data into a new worksheet. See screenshot:

9. Now, you can find the different rows of the two tables quickly and easily. The rows contain the same data of the specified columns are listed in the same row, and the empty columns indicate rows with different data. See screenshot:

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
Comments (0)
No ratings yet. Be the first to rate!
There are no comments posted here yet
Leave your comments
Posting as Guest
Rate this post:
0   Characters
Suggested Locations