Unstack and Restack Data in Excel

QI Macros Makes it Easy to Stack & Unstack Data in Excel

You can find the restacking and unstacking tools in the Data Mining section of the QI Macros menu:

In the April 2020 QI Macros release, the Unstack/Restack tool will now include zeros in your data output!

NOTE: If you have a version of QI Macros released prior to April 2020, and you wish to include zeros in your unstacked/restacked data, the workaround is to find and replace all zeros with an arbitrary number (e.g. 99), before performing the unstack/restack:

Ctrl + F > 0 > Find All > Replace with: 99 > Replace All. Once you have done so, "Replace All" again and change the 99 back to 0.

Stack Data by Columns

Sometimes you need to stack columns of data. By specifying the number of columns to stack, the QI Macros will take the S1:S2 data above and transform it back into a single column (leaving the side-by-side data as well:

Restack Excel tables from JxK to MxN

Stack and Restack takes any size table and switches the data from one size table to a new size.

Original data (6X6):

Resulting data (3X12):

Unstack by Label

Unstack by Label takes any size table and unstacks it based on the labels in column A.

Original data (Labels in Column A, Data in Column B) 
Unstacked into D1:E5 (by Region 1 and 2):

Unstack by Subgroup

Another way to do this is to unstack by subgroup size. Using any number of columns, Unstack by Subgroup will use the number of samples per subgroup (in this case 4) and unstack the data:

Unstack Matrix to List

This functionality is designed to take a group of multi-column data that has multiple labels and groups them into a single-column list of data:

Original Data:


Resulting Data:




  • Only $299 USD - less with quantity discounts
  • No annual subscription fees
  • Free technical support

easy to use

Easy to Use

  • Works right in Excel
  • Create a chart in seconds
  • Easy to customize & share charts

proven and trusted

Proven and Trusted

  • More than 100,000 users
  • In More than 80 countries
  • Five Star CNET Rating - Virus free