Pivot Table Issues

How to Convert Multiple Excel Rows into Columns by Entity and State

Ayan MasoodAyan Masood Oct 26, 2026 868 views

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.

How to Convert Multiple Excel Rows into Columns by Entity and State
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.
Before you start

Ensure your dataset has clear column headers (e.g., Entity ID, Entity Name, State) and no blank rows or columns within the data range.

Solution 1Recommended

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.

1
Insert a Pivot Table

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.

2
Configure Rows and Columns

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.

3
Set the Values

Drag the 'State' field (or any relevant status field) into the Values area. By default, it will show as 'Count of State'.

4
Adjust the Layout

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.

5
Apply Custom Number Formatting

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".

Time Saver: Using a Pivot Table completely automates the restructuring, preventing the need to manually transpose data for hundreds of rows.
WPS Spreadsheet Data Management

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. 1. Open Your Data: Launch WPS Spreadsheet and open the document containing your entity and state data.
  2. 2. Insert PivotTable: Highlight your dataset, navigate to the Insert tab, and click PivotTable.
  3. 3. Arrange Fields: Drag the Entity fields into the Rows box, and the State field into both the Columns and Values boxes.
  4. 4. Format Output: Use the Design tab to switch to Tabular Layout and remove unnecessary subtotals for a clean, restructured view.
Fully compatible with Microsoft Excel (.xlsx, .xls) files.Advanced Pivot Table features to easily switch rows and columns.Free and lightweight alternative to heavy spreadsheet software.Intuitive interface similar to Microsoft Office for zero learning curve.
microsoft office alternative - wps office

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.