Try array entering this formula in A3 of 'Compile'. Fill down and across. Then select / copy A3:G13 and paste into I3 and Q3.
If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.
Formula:
=INDEX(IF(INDIRECT("'"&SUBSTITUTE(LOOKUP("zzzzz",$A$1:A$1)," ","")&"'!$A$3:$G$13")="","",INDIRECT("'"&SUBSTITUTE(LOOKUP("zzzzz",$A$1:A$1)," ","")&"'!$A$3:$G$13")),ROWS($4:4),MATCH(A$3,$A$3:$G$3,0))
Bookmarks