I think it will be easier to solve it by PQ in the "unpivot way", of which I would like to ask for @GraH - Guido , @AlanSidman or @p45cal to give you a help.
Further to Vletm's explanation, here is some more information.
Extract the last part of the formula, it is always in :
=ROW($A1)*4+COLUMN(A$1)-4
Because it is suit with your designed 4 result columns
4 means a serial number will generate in starting from 1 & increase (1,2,3,4,5,6,7,8,9......) in a 4 columns x N rows formula cell areas, something like this :