Data Import & Export

How to Transform a Wide Excel Table into a Larger Array

Maira MehtabMaira Mehtab Nov 11, 2026 869 views

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.

How to Transform a Wide Excel Table into a Larger Array
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.
Before you start

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.

Solution 1Recommended

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.

1
Load data into Power Query

Select any cell inside your wide table, navigate to the 'Data' tab on the Excel ribbon, and click 'From Table/Range'.

2
Select the identifier columns

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

3
Unpivot the remaining 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.

4
Load the transformed array back to Excel

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.

Use Power Query to Unpivot the Data Table
Tip for Future Updates: If you add new columns to your original wide table later, simply right-click the new Power Query array and select 'Refresh' to update the layout automatically.
Free Microsoft Office alternative

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. 1. Download and Install WPS Office: Visit the official WPS website, download the free suite, and install it on your device in minutes.
  2. 2. Open Your Excel File: Launch WPS Spreadsheet and seamlessly open your existing .xlsx workbooks containing the wide tables.
  3. 3. Analyze and Transform: Use powerful built-in pivot tables and comprehensive formula libraries to restructure and analyze your data easily.
Completely free to use with a familiar, easy-to-learn interfaceFully compatible with Microsoft Excel (.xlsx) formats, ensuring your wide tables and formulas load correctlyFeatures rich built-in functions for data lookup, manipulation, and array restructuringLightweight architecture ensures fast performance even when handling large datasets or legacy hardware
microsoft office alternative - wps office

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.