Split Employees and Dependents into Rows with Excel Power Query
Question details
Create a separate row for each employee and dependent from a source table that combines their information.

- Product
- Microsoft Excel Power Query
- Device & OS
- not provided
- Scenario
- An employee table includes optional dependent information on the same row, and the user wants a person-level table.
- Observed behavior
- The desired output has one row per person, a shared employee identifier, each person's own identifier, and a common Name column.
Identify the source columns for the employee ID and name and the dependent ID and name. If the data is not already an Excel table, select it and choose Insert > Table, including the header row.
Append employee and dependent queries in Power Query
Use two queries with matching columns to create a combined person-level table.
The example below assumes columns named EmployeeID, EmployeeName, DependentID, and DependentName. Substitute your actual column names. The employee's PersonID will be the EmployeeID; the dependent's PersonID will be the DependentID.
Select a cell in the Excel table, then choose Data > From Table/Range to open it in Power Query Editor.
In the Queries pane, right-click the source query and choose Reference twice. Rename the new queries Employees and Dependents.
In Employees, keep EmployeeID and EmployeeName using Home > Choose Columns. Right-click EmployeeID and choose Duplicate Column; rename the duplicate PersonID and rename EmployeeName to Name.
In Dependents, keep EmployeeID, DependentID, and DependentName using Home > Choose Columns. Use the DependentID filter to remove null and blank values, then rename DependentID to PersonID and DependentName to Name.
Choose Home > Append Queries > Append Queries as New, select Employees and Dependents, and confirm. Check that EmployeeID, PersonID, and Name contain the expected values, then choose Home > Close & Load.

Work with employee spreadsheets in WPS Office
WPS Office is a free, lightweight Office alternative with a familiar spreadsheet interface. Open compatible Excel files to review and edit employee tables, making it easier to move everyday spreadsheet work between applications. The Power Query transformation above requires Excel.

Frequently Asked Questions
How do I prevent empty dependent rows from appearing?
In the Dependents query, open the DependentID column filter and clear null and blank values before appending the queries.
Why does the employee ID appear twice on an employee row?
The output uses EmployeeID as the shared employee identifier and PersonID as the identifier for the person on that row. For an employee, both values are the employee's ID.
Why did the append create extra columns?
Power Query matches appended columns by name. Check that both queries use exactly EmployeeID, PersonID, and Name, then check their data types in Power Query Editor.
How do I update the result after the source table changes?
After editing or adding rows to the source Excel table, select Data > Refresh All to rerun the queries and update the loaded result.




