How to Transform a Wide Excel Table into a Larger Array
Question details
The user needs to convert a wide, horizontal Excel table into a larger vertical array or an unpivot-style list for better data analysis.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Restructuring an existing wide matrix of data into a linear or flattened tabular format so that it can be easily queried or analyzed.
- Observed behavior
- The data is currently spread across many columns (a wide table) and needs to be dynamically restructured into a vertically stacked array or an unpivoted layout.
Ensure your dataset contains clear headers and no merged cells. If you plan to use dynamic array formulas like TOROW and TOCOL, verify that you are using a compatible version such as Microsoft 365.
Use Power Query to Unpivot the Data Table
Power Query is the most reliable and scalable method for unpivoting wide tables, especially if the source data is updated or grows over time.
By utilizing the Unpivot feature in Power Query, you can quickly transform columns of values into attribute-value pairs without writing complex array formulas.
Select any cell inside your wide table, navigate to the 'Data' tab on the Excel ribbon, and click 'From Table/Range'.
In the Power Query Editor window, click the headers of the columns that you want to keep fixed (e.g., ID, Name, or Date columns).
Right-click the header of your selected columns and choose 'Unpivot Other Columns' from the context menu. This will instantly collapse the wide columns into 'Attribute' and 'Value' rows.
Rename the newly created headers if desired, then click the 'Close & Load' button in the top left corner to output the reshaped larger array into a new worksheet.

Reshape Dynamically Using Array Functions (Microsoft 365)
For a pure formula-based approach without using Power Query, you can combine modern array functions to reshape data dynamically on the worksheet.
Looking for a Free, Powerful Spreadsheet Alternative?
If you need a cost-effective way to manage extensive tables and perform advanced array manipulations, WPS Spreadsheet is an excellent choice. It offers powerful data processing tools, a familiar user interface, and seamless compatibility with Microsoft Excel files without the heavy subscription fees.
- 1. Download and Install WPS Office: Visit the official WPS website, download the free suite, and install it on your device in minutes.
- 2. Open Your Excel File: Launch WPS Spreadsheet and seamlessly open your existing .xlsx workbooks containing the wide tables.
- 3. Analyze and Transform: Use powerful built-in pivot tables and comprehensive formula libraries to restructure and analyze your data easily.

Frequently Asked Questions
What is the TOCOL function in Excel?
TOCOL is a dynamic array function available in Microsoft 365 that converts an entire two-dimensional array or range into a single vertical column. It is ideal for flattening wide ranges.
Can I unpivot data without using Power Query?
Yes, but it is more complex. Without Power Query or Microsoft 365 array formulas, you would have to rely on complicated combinations of INDEX, OFFSET, and MATCH functions, or use an intricate Multiple Consolidation Ranges PivotTable setup.
Why does my dynamic array formula return a #SPILL! error?
A #SPILL! error occurs when the dynamic array formula does not have enough empty adjacent cells to output the complete flattened list. Ensure that all cells below and to the right of your formula are empty.




