Kuifje
Kuifje

Reputation: 103

How to transform an Excel table to another format

I have the following Excel Table:

enter image description here

I would like to transform it into another Table with only 3 columns: the first one with A,B,...C,D,A,B,...,D,..., the second one with 1,2,...,10, and the third one with the corresponding value in the above table.

For example:

Obviously this can be done manually, but I need a faster way to achieve it. Any help is appreciated! Thanks

Upvotes: 0

Views: 86

Answers (1)

Mrig
Mrig

Reputation: 11702

In Cell K1 enter the following formula

=INDEX($B$1:$I$1,1,1+INT((ROW(A1)-1)/ROWS($A$2:$A$11)))

then in Cell L1 enter

=INDEX($A$2:$A$11,MOD(ROW(A1)-1+ROWS($A$2:$A$11),ROWS($A$2:$A$11))+1,1)

finally, in Cell M1 enter

=INDEX($B$2:$I$11,MOD(ROW(A1)-1+ROWS($A$2:$A$11),ROWS($A$2:$A$11))+1,1+INT((ROW(A1)-1)/ROWS($A$2:$A$11)))

Drag/Copy down above formulas as required. See image for reference.

enter image description here

Upvotes: 1

Related Questions