Power Query Problems

How to Automate Converting a Two-Column Excel Table into Four Columns in WPS Office

Olivia MillerOlivia Miller Nov 13, 2026 869 views

Question details

The user needs a repeatable method to convert a two-column Excel table containing group header rows and serial-number rows into a four-column layout showing group names, serial numbers, and sequential item information.

Automate Converting a Two-Column Excel Table into Four Columns with WPS Spreadsheets
Product
WPS Spreadsheets
Device & OS
not provided
Scenario
The source table has group headers and serial-number rows in two columns; the user wants to automate the transformation because it repeats almost every week.
Observed behavior
Manual processing is time-consuming, and the user wants a query or macro that can be refreshed or rerun instead.
Before you start

Open the workbook in WPS Spreadsheets and confirm that the source range has a consistent two-column layout, with a clear marker or blank group column identifying group-header rows. If you plan to use Power Query, keep the source data in a table or named range so the query can be refreshed when new rows are added.

Solution 1Recommended

Use Power Query to Fill Down Group Headers and Build Four Columns

This is the recommended method when the conversion is repeated every week and you want to refresh the result instead of redoing the steps manually.

Power Query records the cleanup steps as a query. When new weekly data is added, refreshing the query repeats the same transformation without rewriting formulas or filtering cells.

Use this method when your group-header rows have a consistent marker or pattern so they can be separated automatically from serial-number rows.

1
Load the source range into Power Query

In WPS Spreadsheets, open the workbook, select a cell in the source two-column range, and click Data > Get Data > From Table/Range. If the Create Table dialog appears, confirm the range and click OK.

2
Fill group values down

In Power Query Editor, select the group name column, then right-click and choose Fill > Down or go to Transform > Fill > Down so every serial-number row inherits the correct group name.

3
Remove group-header rows

Filter the original header marker column or conditional column to exclude the rows that represent group headers, leaving only serial-number rows.

4
Add a sequence column and arrange the layout

Click Add Column > Index Column to create the sequential item information, then drag the columns into the final four-column order: group name, serial number, item information, and sequence.

5
Load and refresh the result

Click Close & Load to place the transformed table in a new worksheet. When new data arrives, add it to the source table and click Data > Refresh All.

Use Power Query to Fill Down Group Headers and Build Four Columns
Weekly refresh: After the query is loaded, Data > Refresh All re-applies the fill down, filtering, and index steps to the latest source rows.
Direct solution in WPS Spreadsheets

Automate Weekly Two-Column to Four-Column Table Conversion with WPS Spreadsheets

WPS Spreadsheets can load the two-column source table into Power Query, fill group names down, remove header rows, add sequence information, and refresh the final four-column layout whenever new data is added.

  1. 1. Open WPS Spreadsheets and load the source range: Launch WPS Office, open the workbook, select the two-column source range, and click Data > Get Data > From Table/Range to open Power Query.
  2. 2. Fill the group names down: In Power Query Editor, right-click the group name column and choose Fill > Down so each serial-number row gets the correct group name.
  3. 3. Remove group-header rows: Filter the marker column or conditional column to exclude group-header rows, leaving only serial-number rows.
  4. 4. Add sequence and final columns: Click Add Column > Index Column, then reorder the columns into group name, serial number, item information, and sequence.
  5. 5. Load and refresh weekly: Click Close & Load to place the result in a new sheet. Next week, add data to the source and click Data > Refresh All to regenerate the four-column table.
Refreshable Power Query workflow for repeated weekly table conversion.Preserves .xlsx compatibility with Microsoft Excel.No manual cutting, filling, or filtering after the query is created.Familiar spreadsheet interface with easy Data and Power Query tools.
QA img-9

Frequently Asked Questions

Can I refresh the four-column table after adding next week's data?

Yes. Load the source into Power Query, add the new rows to the source table or range, and click Data > Refresh All in WPS Spreadsheets. The query re-applies fill down, filtering, and index steps.

What if my group headers do not use the same marker?

Add a conditional column in Power Query or make the source marker consistent before loading it. The fill-down and filter steps depend on a reliable way to separate group-header rows from serial-number rows.

Will the transformed workbook stay compatible with Microsoft Excel?

Yes. WPS Spreadsheets saves .xlsx workbooks that remain compatible with Microsoft Excel, so you can open and edit the result in either application.

Can I automate this with VBA instead of Power Query?

Yes. You can run a VBA macro that rearranges the columns, fills down group values, converts formulas to values, and deletes header rows. Use it on a copy if the source layout changes.