How to Convert Multiple Excel Rows into Columns by Entity and State
Question details
The user needs to consolidate multiple rows per entity into a single row, converting state data into separate columns without manually restructuring the dataset.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Restructuring a dataset with approximately 100 rows containing entity identifiers and operating states.
- Observed behavior
- The data currently has multiple rows for each entity (one for each operating state), and the goal is to have one row per entity with states displayed as distinct columns.
Ensure your dataset has clear column headers (e.g., Entity ID, Entity Name, State) and no blank rows or columns within the data range.
Use a Pivot Table to Transpose Rows to Columns
The most efficient way to restructure your data is by using a Pivot Table, which automatically consolidates entities and creates state columns.
A Pivot Table groups identical entities together and pivots the state attributes across the top as headers, saving you the trouble of manual copy-pasting.
Select your entire source data range. Go to the Insert tab on the ribbon and click on PivotTable, then choose to place it on a New Worksheet.
In the PivotTable Fields pane, drag the 'Entity Identifier' and 'Entity Name' fields to the Rows area. Then, drag the 'State' field to the Columns area.
Drag the 'State' field (or any relevant status field) into the Values area. By default, it will show as 'Count of State'.
Select any cell in the Pivot Table. Go to the Design tab, click Report Layout, and choose 'Show in Tabular Form'. Next, click Subtotals and select 'Do Not Show Subtotals' to clean up the view.
To display a text label like "Yes" instead of the number 1, right-click a value cell, select Value Field Settings, click Number Format, choose Custom, and type "Yes";;"Yes";"Yes".
Use Power Query to Pivot Columns
Power Query offers a robust alternative for pivoting data, especially if this source data will be updated frequently.
Restructure Your Data Quickly in WPS Spreadsheet
WPS Spreadsheet provides powerful Pivot Table and data transformation features, allowing you to convert rows to columns effortlessly. It is fully compatible with Microsoft Excel formats.
- 1. Open Your Data: Launch WPS Spreadsheet and open the document containing your entity and state data.
- 2. Insert PivotTable: Highlight your dataset, navigate to the Insert tab, and click PivotTable.
- 3. Arrange Fields: Drag the Entity fields into the Rows box, and the State field into both the Columns and Values boxes.
- 4. Format Output: Use the Design tab to switch to Tabular Layout and remove unnecessary subtotals for a clean, restructured view.

Frequently Asked Questions
Why is my Pivot Table counting the states instead of showing text?
By default, Pivot Tables aggregate text fields using 'Count'. To display specific text like 'Yes' instead of numbers, you must apply a custom number format (such as "Yes";;"Yes";"Yes") to the value field settings.
Can I use the Paste Special Transpose function instead of a Pivot Table?
The standard Paste Special > Transpose function only rotates the entire dataset 90 degrees. It does not consolidate duplicate entities, making Pivot Tables the better choice for this specific data merging task.
How do I update the Pivot Table if I add new states or entities?
Simply add the new rows to your original source table, right-click anywhere inside your existing Pivot Table, and select 'Refresh'. The new rows and columns will populate automatically.




