Transpose Account Rows into One Row per Client in Excel Power Query
Question details
Create one row per client with the client address and each account number in a separate column.

- Product
- Microsoft Excel Power Query
- Device & OS
- not provided
- Scenario
- A source table contains multiple account rows for each client, with client or address values potentially shown only on the first row.
- Observed behavior
- The desired output is a table with one row per client, a preserved address, and separate columns for the client's account numbers.
Check that each client has a stable identifier and one consistent address, and identify blank cells that should inherit values from the preceding row. Confirm that account numbers are stored as text if leading zeros must be preserved.
Group and pivot account numbers in Excel Power Query
Use this method to turn multiple account rows into separate columns while retaining each client's address.
Select a cell in the source data and choose Data > From Table/Range to open it in Power Query Editor. Confirm that the table has headers, including Client ID, Address, and Account Number.
Select the Client ID and Address columns, then choose Transform > Fill > Down if blank cells mean the values continue from the row above. Check the results, especially at client boundaries, so an address is not carried into the wrong client.
Set Account Number to the Text data type, filter out rows without an account number, and remove columns you do not need in the output. Keep Client ID, Address, Account Number, and any other consistent client-identifying columns you want to preserve.
Choose Home > Group By, select Advanced, and group by Client ID, Address, and any other retained client-identifying columns. Name the new column Rows and choose All Rows as the operation.
Choose Add Column > Custom Column, name it Indexed Rows, and enter Table.AddIndexColumn([Rows], "Account Index", 1, 1, Int64.Type). Remove the original Rows column, then expand Indexed Rows and select only Account Number and Account Index.
Select Account Index and choose Transform > Format > Add Prefix to add Account as a prefix, or create a text column with "Account " & Text.From([Account Index]). Select the resulting index column, choose Transform > Pivot Column, and select Account Number as the values column. Under Advanced options, choose Don't Aggregate.
Check that each client has one row and that the account columns contain the expected values. Choose Home > Close & Load to return the table to Excel.

Review client account tables with WPS Spreadsheets
WPS Office is a free, lightweight alternative with a familiar spreadsheet interface. Open compatible Excel files to review and edit the resulting client account table as you migrate between Office tools; Excel Power Query itself remains a Microsoft feature.

Frequently Asked Questions
Why did one client appear on more than one output row?
The grouping uses both Client ID and Address. If a client has different address values, Power Query creates separate groups. Check and standardize the address values before choosing Home > Group By.
How can I keep leading zeros in account numbers?
In Power Query Editor, select Account Number and set its data type to Text before pivoting. If zeros were already removed from the source, restore them from the original data first.
What happens if clients have different numbers of accounts?
The pivot creates enough account columns for the largest group. Clients with fewer accounts have null values in the extra columns.
Can I refresh the result when new accounts are added?
Add the records to the source table, then use Data > Refresh All in Excel. Power Query reruns the transformations and updates the loaded table.
Does WPS Spreadsheets run this Excel Power Query?
The grouping and pivot steps described here use Microsoft Excel Power Query. WPS Spreadsheets can open compatible XLSX files for reviewing the resulting table, but it is not a replacement for running this Power Query workflow.




