Your data organization does not follow a row pattern, so it is difficult to import them as desired.
I copied your Template to the Question & Answers file to make this job easier.
I organized the questions so they are in the same row across all category columns.
Then I use this formula in helper column T in the Questions tab, to index the rows with questions, in T15 copied down to T23:
Formula:
=IF(ISEVEN(ROW()),0,"Q"&COUNTIF($T$14:T14,"<>"&0))
I could not do this in the Answers tab, because, as mentioned above, the answers across categories are not listed in the same row. I just manually entered Q1 for the first answer row.
Also, I changed columns C & D headers in Template tab, to match respective tabs (Questions & Answers), to make use of the INDIRECT function in this formula in C4, copied across and down:
Formula:
=IFERROR(INDEX(INDIRECT("'"&C$3&"'!A15:R26"),MATCH($B4,INDIRECT("'"&C$3&"'!T15:T23"),0),MATCH(OFFSET($A4,-MOD(ROWS($Z$1:$Z1)-1,5),0),INDIRECT("'"&C$3&"'!A12:R12"),0)),"")
Finally, to list categories from cell A9 I use this formula in A9 and copied down. This formula is based on the 5-row increment as it is copied down the merged cells:
Formula:
=INDEX(Questions!$A$12:$R$12,1+QUOTIENT(ROWS($Z$4:Z9),5)*3)
This is just an idea to help you get started.
Hopefully, after you manage to organize your data, it will guide you through to get the job completed.
Please check file attached.
Good luck!
Bookmarks