How to Unpivot Cross-Tab Excel Data into Rows Without VBA
Question details
The user needs to reshape a cross-tab table where hours are spread across columns such as A Hours through D Hours into individual rows containing Date, Name, and Hours, without using VBA.

- Product
- WPS Spreadsheet (Power Query)
- Device & OS
- not provided
- Scenario
- The user has a crosstab source table with Date and Name identifier columns and multiple hour columns. They want a normalized table with one row per Date-Name-hour combination for reporting or further analysis.
- Observed behavior
- The current table stores hour values in multiple columns, and zero or blank hour values should be excluded from the final unpivoted result.
Open the workbook containing the cross-tab table and confirm that the source range has unique headers for Date, Name, A Hours, B Hours, C Hours, and D Hours. Make the source range an Excel Table if possible so Power Query automatically keeps the range connection.
Use Power Query Unpivot Columns in WPS Spreadsheet
This is the most maintainable solution when the source table may grow or change and you want a repeatable data-cleaning process.
Power Query performs the unpivot operation without VBA by selecting the hour columns and converting them from column headers into row values. You can then rename the generated value column and filter out unwanted zero or blank rows before loading the result to another worksheet.
Click any cell inside the source table, then go to the Data tab and choose From Table/Range. If the range is not already a table, confirm that WPS Spreadsheet should create one.
In the Power Query Editor, hold Ctrl and select the A Hours, B Hours, C Hours, and D Hours columns.
Go to Transform > Unpivot Columns. Power Query creates Attribute and Value columns from the selected hour columns.
Right-click the Value column and choose Rename, then type Hours. Open the filter on the Hours column and remove blank values, and uncheck zero if zero-hour rows should not be included.
Click Close & Load To, choose a new worksheet, and confirm to output the unpivoted Date, Name, and Hours table.

Use an Excel 365 dynamic-array formula as a one-off alternative
Use this when you cannot load the file into Power Query and need a formula-based unpivot result in Excel 365.
Unpivot Cross-Tab Data in WPS Spreadsheet with Power Query
Use WPS Spreadsheet to load your Excel cross-tab table into Power Query, unpivot the A Hours through D Hours columns into Date, Name, and Hours rows, filter zero or blank hour values, and load the result to a new worksheet—no VBA required.
- 1. Open the workbook in WPS Spreadsheet: Open the Excel file that contains the cross-tab table with Date, Name, and A Hours through D Hours columns.
- 2. Open Power Query from the Data tab: Click inside the source table, go to Data > From Table/Range, and confirm the table range in the Power Query dialog.
- 3. Unpivot the hour columns: In Power Query Editor, Ctrl-click A Hours through D Hours, then choose Transform > Unpivot Columns.
- 4. Rename and filter the Hours values: Rename the Value column to Hours, then use the Hours filter to remove blank and zero values.
- 5. Close and load to a new worksheet: Click Close & Load To, select a new worksheet as the destination, and load the Date, Name, and Hours rows.

Frequently Asked Questions
Can WPS Spreadsheet unpivot cross-tab data without VBA?
Yes. Load the table into Power Query with Data > From Table/Range, select the A Hours through D Hours columns, and choose Transform > Unpivot Columns. Then rename the Value column to Hours and load the result.
How do I exclude zero or blank hours after unpivoting?
In Power Query Editor, click the filter arrow on the Hours column, clear blank values, and uncheck 0 before applying the filter. The output then contains only non-zero, non-blank hour rows.
Does the Power Query result update when the source table changes?
Yes. Because the output remains connected to the source query, you can refresh it from Data > Refresh All or by right-clicking the result table and choosing Refresh.
Can I use an Excel 365 formula instead of Power Query?
Yes. Excel 365 users can use a dynamic-array formula with LET, TOCOL, HSTACK, FILTER, and LAMBDA to unpivot the hour columns and exclude blank values. However, Power Query is generally more maintainable.
What should I do if the A Hours through D Hours columns are not adjacent?
In Power Query Editor, hold Ctrl and click each hour column individually, then choose Transform > Unpivot Columns. Non-adjacent columns can be selected and unpivoted the same way.




