logo
search
Power Query Problems

How to Align Two Excel Tables and Insert Blank Rows Using Power Query

WPS Content ManagerWPS Content Manager Oct 8, 2026 868 views

Question details

The user wants to compare two side-by-side Excel tables and align matching records based on specific columns while automatically inserting blank rows where data is missing.

How to Align Two Excel Tables and Insert Blank Rows for Missing Data
Product
Excel 365
Device & OS
not provided
Scenario
Aligning two separate datasets with matching identifiers (like Plan and Elev) into a single unified view without using VBA macros.
Observed behavior
Needs an automated, repeatable way to merge tables and display blanks for non-matching records instead of manual alignment or complex nested formulas.
Before you start

Ensure both of your datasets are formatted as official Excel Tables (press Ctrl + T) and that they share identically named columns for the identifiers you want to match, such as 'Plan' and 'Elev'.

Solution 1Recommended

Align Tables Using Power Query Full Outer Join

Using a Full Outer Join in Excel 365 Power Query allows you to merge both tables and automatically generate blank cells where records do not match, without writing any code.

A Full Outer Join combines all rows from both tables. When a match is found based on your specified columns, the data aligns on the same row. If a record exists in only one table, Power Query will output null (blank) values for the missing data from the other table.

1
Import Tables into Power Query

Click anywhere inside your first table, go to the Data tab on the ribbon, and select 'From Table/Range'. Once the Power Query Editor opens, click 'Close & Load To...' and choose 'Only Create Connection'. Repeat this process for the second table.

2
Merge the Queries

In Excel, go to Data > Get Data > Combine Queries > Merge. This will open the Merge dialog box.

3
Select Matching Columns

In the Merge window, select your first table from the top dropdown and your second table from the bottom dropdown. Click on the column headers (e.g., 'Plan' and 'Elev') in both previews to highlight the matching criteria. Hold CTRL to select multiple columns.

4
Apply Full Outer Join

At the bottom of the Merge dialog, locate the 'Join Kind' dropdown menu. Select 'Full Outer (all rows from both)' and click OK.

5
Expand and Sort Data

In the resulting Power Query Editor window, click the expand icon (two diverging arrows) on the header of the newly merged column. Uncheck the columns you don't need and click OK. Finally, use the sort buttons on your key columns to group matching records together.

6
Load the Aligned Table

Click 'Close & Load' from the Home tab to output the newly aligned dataset into a fresh Excel worksheet.

Align Tables Using Power Query Full Outer Join
Highly Repeatable Process: This method avoids macros and VBA. If your original source data changes, you only need to right-click the aligned table and select 'Refresh' to instantly update the results.
Free Microsoft Office alternative

Try WPS Office for Your Spreadsheet Needs

While Power Query is a specific feature of Excel 365, WPS Office provides a lightweight, free, and highly compatible alternative for standard data analysis, alignment, and formatting tasks without expensive subscription fees.

  1. 1. Download and Install: Visit the official WPS Office website and download the free installation package for your operating system.
  2. 2. Open Your Excel Files: Launch WPS Spreadsheets and open your existing .xlsx or .xls files directly. Your formatting and standard formulas will be preserved.
  3. 3. Analyze Data: Use powerful built-in functions like XLOOKUP, pivot tables, and conditional formatting to analyze and align your data effectively.
Seamless compatibility with Microsoft Excel (.xlsx, .xls, .csv) formats.Built-in data comparison, VLOOKUP, and highlighting features.Completely free to use with a familiar, user-friendly tabbed interface.Lightweight software that installs quickly and runs smoothly on older devices.
microsoft office alternative - wps office

Frequently Asked Questions

Can I align two tables and insert blank rows using formulas instead of Power Query?

Yes, you can use advanced formulas combining IF, IFERROR, and XLOOKUP or INDEX/MATCH across multiple columns. However, Power Query is significantly faster and handles the insertion of missing blank rows automatically without needing complex nested logic.

Why did my Full Outer Join create duplicate rows?

Duplicates occur in a merge if your selected identifier columns (e.g., Plan and Elev) do not contain strictly unique combinations in your source tables. Ensure your tables have unique identifier keys before performing the join.

Will my merged table update if I add new data to the original tables?

Yes. One of the primary advantages of Power Query is that it retains your transformation steps. Simply add your new data to the original tables, then right-click your merged output table and click 'Refresh' to update the layout.