Maybe like this. Drag across and down to give the desired size.

=INDEX($A$1:$T$1,ROWS($D$4:$D4)+(COLUMNS($D$4:D$4)-1)*5)