The table that I am using looks like this
X x1 x1 x1 x1 x1 x1 x1 x1 x2 x2 x2 x2
Y y1 y1 y1 y1 y2 y2 y2 y2 y1 y1 y1 y1
Z z1 z2 z3 z4 z1 z2 z3 z4 z1 z2 z3 z4
30% 23 22 25 19 24 27 22 32 21 19 31 29
31% 25 23 27 22 26 29 24 33 24 22 33 31
32% 29 26 31 25 28 33 27 36 27 25 35 33
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
300% 500 520 613 476 512 312 324 754 432 345 421 444
What I am trying to achieve is something like this
X Y Z Per. Value
x1 y1 z1 30% 23
x1 y1 z1 31% 25
x1 y1 z1 32% 29
. . . . .
. . . . .
x1 y1 z1 300% 500
x1 y1 z2 30% 22
x1 y1 z2 31% 23
x1 y1 z2 32% 26
. . . . .
. . . . .
x1 y2 z1 30% 24
x1 y2 z1 31% 26
. . . . .
. . . . .
x1 y2 z4 30% 32
x1 y2 z4 31% 33
. . . . .
. . . . .
. . . . .
x10 y3 z7 300% 431
I tried using the macro given in this thread How to "flatten" or "collapse" a 2D Excel table into 1D?, but couldn't get it to work, probably because my table is more than 2D, more like 4D. I am not a macro expert.
Is there any way to convert the first table to look like second table, macros or otherwise. I realize that it dramatically increases the number of rows, but that is not a problem.