Unstack and Restack Data in Excel

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

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


NOTE: The Unstack/Restack tool does not process zeros.

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

Unstack Tables Using Labels

Unstack by Labels 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 Labels by Subgroup

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

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)

Create these charts and diagrams in just seconds using QI Macros for Excel...