How to Combine Repeated Columns into Rows with Excel Power Query
Question details
The user needs to transform horizontal form data that contains multiple repeated column groups (e.g., first name, last name, and age for multiple children) into a vertical format with a single column set and one row per child.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Organizing form response data where respondents can submit multiple records (like multiple children) in a single horizontal row, requiring it to be flattened for data analysis.
- Observed behavior
- The data is spread horizontally across multiple repeated columns, making it difficult to analyze, count, or filter individual records.
Ensure your source data is formatted as an official Excel Table by pressing Ctrl + T, and verify that your column headers have clear, distinct names before opening Power Query.
Use Power Query to Unpivot Repeated Columns
The most efficient way to transform horizontal, repeated column sets into separate vertical rows is by using the Unpivot feature inside the Power Query Editor.
Power Query is preferable to using complex CONCAT or TEXTJOIN formulas for this task because it generates actual separate rows for each data entity, keeping your dataset structured and ready for pivot tables or charts.
Select any cell inside your data table, navigate to the Data tab on the Excel ribbon, and click 'From Table/Range'. This action opens the Power Query Editor window.
In the Power Query Editor, hold down the Ctrl key and click the headers of all the repeated columns (e.g., Child 1 Name, Child 2 Name, Child 1 Age, Child 2 Age) that you want to flatten into rows.
Right-click on one of the highlighted column headers and select 'Unpivot Columns' from the drop-down menu. Your data will instantly reformat, shifting the selected column headers into an 'Attribute' column and the row data into a 'Value' column.
Double-click the new 'Attribute' and 'Value' headers to rename them appropriately (e.g., 'Field' and 'Data'). If needed, use the 'Split Column' feature on the Home tab to separate number identifiers from text in the Attribute column.
Once your data is correctly shaped, click the 'Close & Load' button located on the Home tab. This will export your freshly transformed, row-based data into a new worksheet.

Use 'Unpivot Other Columns' for Expanding Data
If your form might add more repeated columns in the future (e.g., a 4th or 5th child option), unpivoting 'other' columns based on your static columns ensures new fields are processed automatically.
Try WPS Office for Seamless Data Management
While Power Query is a specific feature for advanced data reshaping in Excel, WPS Office provides a lightweight, highly compatible, and free alternative for managing, analyzing, and visualizing your daily spreadsheet data.
- 1. Download WPS Office: Visit the official WPS website and click on the 'Free Download' button.
- 2. Install the Software: Run the downloaded installer and follow the simple on-screen instructions to set up WPS Office on your computer.
- 3. Open Your Spreadsheets: Launch WPS Spreadsheets and open your .xlsx files directly. Enjoy seamless formatting and formula compatibility.

Frequently Asked Questions
Why shouldn't I use CONCATENATE or TEXTJOIN to combine these columns?
While functions like TEXTJOIN can merge text from multiple columns into a single cell, they do not create new individual rows for each record. Power Query's Unpivot feature is strictly necessary when you need to reshape horizontal data into vertical rows for proper database structure.
Can I update the unpivoted data if new form responses are added?
Yes. Power Query creates a repeatable transformation process. Simply paste or type the new data into your original source table, navigate to your Power Query result table, right-click, and select 'Refresh' to apply the steps to the new rows.
What happens if a respondent leaves a column blank?
When unpivoting columns in Power Query, completely blank (null) cells are typically ignored by default. This means Power Query will not create an empty row for a missing entry, which automatically keeps your transformed data clean.




