Function Problems

How to Transpose Multiple Color Values Across Rows in Excel

Steve KSteve K Nov 11, 2026 869 views

Question details

The user wants to group vertically stored data attributes (like color options) by a category (style number) and output them horizontally across rows.

How to Transpose Multiple Color Values Across Rows in Excel
Product
Excel 365
Device & OS
not provided
Scenario
Reformatting a dataset where multiple attributes for a single item are listed in separate rows, converting them into a dynamic table with one row per item and attributes spread across columns.
Observed behavior
The data needs to be dynamically grouped and spilled horizontally using modern array formulas without manual copying or pivoting.
Before you start

Ensure you are using a version of Excel that supports dynamic array functions (like Excel 365 or Excel 2021) and that your data columns are defined as named ranges or structured table references.

Solution 1Recommended

Use REDUCE and VSTACK Dynamic Array Functions

Utilize modern array functions to dynamically iterate through your data, group it by category, and stack the transposed results into a single spilling output.

This method leverages advanced functions like LET, REDUCE, VSTACK, and LAMBDA. It creates a loop that iterates over unique style numbers, extracts the corresponding colors using FILTER and TOROW, and stacks them into a new dynamic table.

1
Identify Source Data

Define the named ranges for your source data. In this example, the category column is named 'StyleNumber' and the attribute column is named 'ColourInfo'.

2
Select Output Cell

Click on the top-left empty cell where you want the new dynamic table to begin spilling.

3
Input the Dynamic Formula

Enter the following formula: =LET(styles,SORT(UNIQUE(StyleNumber)), pivot,LAMBDA(acc,v, LET(record,TOROW(FILTER(ColourInfo,StyleNumber=v),,1), IFERROR(VSTACK(acc,HSTACK(v,record)),""))), DROP(REDUCE("",styles,pivot),1))

4
Apply and Spill

Press Enter. The formula will calculate and automatically spill the transposed color values across the adjacent rows and columns, grouped by each unique style number.

Use REDUCE and VSTACK Dynamic Array Functions
Dynamic Updates: Because this method uses dynamic arrays, any new styles or colors added to the source data will automatically update and spill properly in the output table.
Advanced Data Processing

Easily Transpose and Group Data in WPS Office

WPS Spreadsheet supports advanced dynamic array functions and provides powerful data processing tools to help you transpose, group, and analyze complex datasets seamlessly.

  1. 1. Open Your Dataset: Launch WPS Spreadsheet and open your existing dataset containing the vertical records.
  2. 2. Select Target Range: Click on the destination cell where you want your transposed data to appear.
  3. 3. Apply Functions or PivotTools: Use built-in dynamic array functions like UNIQUE and FILTER in the formula bar, or utilize the PivotTable feature from the 'Insert' tab to restructure your rows and columns visually.
  4. 4. Save as XLSX: Save your completed file seamlessly in the standard .xlsx format to retain full functionality and formatting.
Fully compatible with Microsoft Excel formulas, including dynamic array functions.Lightweight software with a familiar, easy-to-navigate interface.Built-in advanced PivotTable features for quick, code-free data restructuring.Free to use for everyday professional spreadsheet tasks.
microsoft office alternative - wps office

Frequently Asked Questions

Can I group and transpose data without Excel 365 dynamic arrays?

Yes, in older versions of Excel, you can use Power Query to group your data by the style number and pivot the color column. Alternatively, you can use traditional INDEX and MATCH formulas combined with helper columns.

Why is my dynamic array formula returning a #SPILL! error?

A #SPILL! error occurs when the dynamic array formula does not have enough empty adjacent cells to display all the calculated results. Clear any blocking data in the spill range to resolve the error.

How does the TOROW function help in this scenario?

The TOROW function transforms an array or a specific range into a single row. In this formula, it takes the vertically filtered list of colors for a specific style and lays them out horizontally so they can be stacked.