в основном, вы просите об этом:
={"header for A", "header for B"; ARRAYFORMULA(A2:B)}
обратите внимание, что во избежание ошибки массива необходимо определить заголовок для каждого столбца, даже если он пуст ""
={""; ARRAYFORMULA(IFERROR(SUBSTITUTE(SPLIT(TRIM(
TRANSPOSE(QUERY(TRANSPOSE(SUBSTITUTE(IF(LEN($A$3:$L), {
IF(TRANSPOSE(QUERY(TRANSPOSE($A$3:$L),,999^99))=IFERROR(VLOOKUP(
TRANSPOSE(QUERY(TRANSPOSE($A$3:$L),,999^99)),
TRANSPOSE(QUERY(TRANSPOSE('T1'!$A$3:$L),,999^99)),1,0)), "T1", ),
IF(TRANSPOSE(QUERY(TRANSPOSE($A$3:$L),,999^99))=IFERROR(VLOOKUP(
TRANSPOSE(QUERY(TRANSPOSE($A$3:$L),,999^99)),
TRANSPOSE(QUERY(TRANSPOSE('B1'!$A$3:$L),,999^99)),1,0)), "B1", ),
IF(TRANSPOSE(QUERY(TRANSPOSE($A$3:$L),,999^99))=IFERROR(VLOOKUP(
TRANSPOSE(QUERY(TRANSPOSE($A$3:$L),,999^99)),
TRANSPOSE(QUERY(TRANSPOSE('T2'!$A$3:$L),,999^99)),1,0)), "T2", ),
IF(TRANSPOSE(QUERY(TRANSPOSE($A$3:$L),,999^99))=IFERROR(VLOOKUP(
TRANSPOSE(QUERY(TRANSPOSE($A$3:$L),,999^99)),
TRANSPOSE(QUERY(TRANSPOSE('B2'!$A$3:$L),,999^99)),1,0)), "B2", ),
IF(TRANSPOSE(QUERY(TRANSPOSE($A$3:$L),,999^99))=IFERROR(VLOOKUP(
TRANSPOSE(QUERY(TRANSPOSE($A$3:$L),,999^99)),
TRANSPOSE(QUERY(TRANSPOSE('M1'!$A$3:$L),,999^99)),1,0)), "M1", ),
IF(TRANSPOSE(QUERY(TRANSPOSE($A$3:$L),,999^99))=IFERROR(VLOOKUP(
TRANSPOSE(QUERY(TRANSPOSE($A$3:$L),,999^99)),
TRANSPOSE(QUERY(TRANSPOSE('B3'!$A$3:$L),,999^99)),1,0)), "B3", ),
IF(TRANSPOSE(QUERY(TRANSPOSE($A$3:$L),,999^99))=IFERROR(VLOOKUP(
TRANSPOSE(QUERY(TRANSPOSE($A$3:$L),,999^99)),
TRANSPOSE(QUERY(TRANSPOSE('M2'!$A$3:$L),,999^99)),1,0)), "M2", ),
IF(TRANSPOSE(QUERY(TRANSPOSE($A$3:$L),,999^99))=IFERROR(VLOOKUP(
TRANSPOSE(QUERY(TRANSPOSE($A$3:$L),,999^99)),
TRANSPOSE(QUERY(TRANSPOSE('B4'!$A$3:$L),,999^99)),1,0)), "B4", )}, ),
" ", "♦")),,999^99))), " "), "♦", " ")))}
примечание: если вы получите ARRAY LITERAL error
, вам нужно будет добавить еще ""
, например: ={"", "", "", ""; ARRAYF....