Spreadsheet: 724419d1616156222-joining-columns-vertically-with-dynamic-array-functions-joining-columns-vertically_bo_ry
Sheet: Sheet1

 |  |  |  |  |  |  |  |  | Result
Table 1 |  | Table 2 |  |  | Table 3 |  |  |  | Table 4 |  |  |  |  |  |  |  | 1
Column1 |  | Column2 | Column3 |  | Column4 | Column5 | Column6 |  | Column7 | Column8 | Column9 |  | Column1 | Column2 | Column3 |  | 2 |  |  | 4 | 17
1 |  | A | 6 |  | A |  | 56 |  | 1 |  |  |  | 1 |  |  |  | 3
2 |  | B | 7 |  | Z |  | 8 |  | 2 |  |  |  | 2 |  |  |  | 4
3 |  | C | 8 |  | X | d | 8 |  | 3 |  |  |  | 3 |  |  |  | 5 |  | 1
4 |  | D | 9 |  | 567 |  | p |  | 4 |  |  |  | 4 |  |  |  | 6 |  | 1
 |  |  | i |  | 568 |  | p |  | A | 6 |  |  | A | 6 |  |  | 7 |  | 1
 |  |  | i |  | 569 |  | p |  | B | 7 |  |  | B | 7 |  |  | 8 |  | 2
 |  |  | i |  | 570 |  | p |  | C | 8 |  |  | C | 8 |  |  | 9 |  | 2
 |  |  |  |  | 571 |  | p |  | D | 9 |  |  | D | 9 |  |  | 10 |  | 2
 |  |  |  |  | 572 |  | p |  | A |  | 56 |  | A |  | 56 |  | 11 |  | 2
 |  |  |  |  |  |  |  |  | Z |  | 8 |  | Z |  | 8 |  | 12 |  | 2
 |  |  |  |  |  |  |  |  | X | d | 8 |  | X | d | 8 |  | 13 |  | 2
 |  |  |  |  |  |  |  |  | 567 |  | p |  | 567 |  | p |  | 14 |  | 2
=LET(a;A4:[NAME]:D7;c;F4:H7;d;SEQUENCE(ROWS(a)+ROWS(b)+ROWS(c));f;CHOOSE({1;2;3};0;ROWS(a);ROWS(a)+ROWS(b));g;IFERROR(INDEX((a;b;c);d-LOOKUP(d-1;f);{1;2;3};MATCH(d-1;f));"");IF(g=0;"";g)) |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 15 |  | 2
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 16 |  | 2
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 17 |  | 2
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 18 |  | 2
a | A4:A7 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 19 |  | 2
b | C4:D7 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 20 |  | 2
c | F4:H7 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 3
d | SEQUENCE(ROWS(A4:A7)+ROWS(C4:D7)+ROWS(F4:H7)) |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 3
f | CHOOSE({1;2;3};0;ROWS(A4:A7);ROWS(C4:D7)+ROWS(F4:H7)) |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 3
g | IFERROR(INDEX((A4:[NAME]:D7;F4:H7);SEQUENCE(ROWS(A4:A7)+ROWS(C4:D7)+ROWS(F4:H7))-LOOKUP(SEQUENCE(ROWS(A4:A7)+ROWS(C4:D7)+ROWS(F4:H7))-1;CHOOSE({1;2;3};0;ROWS(A4:A7);ROWS(C4:D7)+ROWS(F4:H7)));{1;2;3};MATCH(SEQUENCE(ROWS(A4:A7)+ROWS(C4:D7)+ROWS(F4:H7))-1;CHOOSE({1;2;3};0;ROWS(A4:A7);ROWS(C4:D7)+ROWS(F4:H7))));"") |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 3
 | IF(IFERROR(INDEX((A4:[NAME]:D7;F4:H7);SEQUENCE(ROWS(A4:A7)+ROWS(C4:D7)+ROWS(F4:H7))-LOOKUP(SEQUENCE(ROWS(A4:A7)+ROWS(C4:D7)+ROWS(F4:H7))-1;CHOOSE({1;2;3};0;ROWS(A4:A7);ROWS(C4:D7)+ROWS(F4:H7)));{1;2;3};MATCH(SEQUENCE(ROWS(A4:A7)+ROWS(C4:D7)+ROWS(F4:H7))-1;CHOOSE({1;2;3};0;ROWS(A4:A7);ROWS(C4:D7)+ROWS(F4:H7))));"")=0;"";IFERROR(INDEX((A4:[NAME]:D7;F4:H7);SEQUENCE(ROWS(A4:A7)+ROWS(C4:D7)+ROWS(F4:H7))-LOOKUP(SEQUENCE(ROWS(A4:A7)+ROWS(C4:D7)+ROWS(F4:H7))-1;CHOOSE({1;2;3};0;ROWS(A4:A7);ROWS(C4:D7)+ROWS(F4:H7)));{1;2;3};MATCH(SEQUENCE(ROWS(A4:A7)+ROWS(C4:D7)+ROWS(F4:H7))-1;CHOOSE({1;2;3};0;ROWS(A4:A7);ROWS(C4:D7)+ROWS(F4:H7))));""))
 | IF(IFERROR(INDEX((A4:[NAME]:D7;F4:H7);SEQUENCE(ROWS(A4:A7)+ROWS(C4:D7)+ROWS(F4:H7))-LOOKUP(SEQUENCE(ROWS(A4:A7)+ROWS(C4:D7)+ROWS(F4:H7))-1;CHOOSE({1\2\3};0;ROWS(A4:A7);ROWS(C4:D7)+ROWS(F4:H7)));{1\2\3};MATCH(SEQUENCE(ROWS(A4:A7)+ROWS(C4:D7)+ROWS(F4:H7))-1;CHOOSE({1\2\3};0;ROWS(A4:A7);ROWS(C4:D7)+ROWS(F4:H7))));"")=0;"";IFERROR(INDEX((A4:[NAME]:D7;F4:H7);SEQUENCE(ROWS(A4:A7)+ROWS(C4:D7)+ROWS(F4:H7))-LOOKUP(SEQUENCE(ROWS(A4:A7)+ROWS(C4:D7)+ROWS(F4:H7))-1;CHOOSE({1\2\3};0;ROWS(A4:A7);ROWS(C4:D7)+ROWS(F4:H7)));{1\2\3};MATCH(SEQUENCE(ROWS(A4:A7)+ROWS(C4:D7)+ROWS(F4:H7))-1;CHOOSE({1\2\3};0;ROWS(A4:A7);ROWS(C4:D7)+ROWS(F4:H7))));""))
 |  |  |  |  |  |  |  |  |  |  |  |  | 2
 |  |  |  |  |  |  |  |  |  |  |  |  | 3
 |  |  |  |  |  |  |  |  |  |  |  |  | 4
 |  |  |  |  |  |  |  |  |  |  |  |  | A | 6
 |  |  |  |  |  |  |  |  |  |  |  |  | B | 7
 |  |  |  |  |  |  |  |  |  |  |  |  | C | 8
 |  |  |  |  |  |  |  |  |  |  |  |  | D | 9
 |  |  |  |  |  |  |  |  |  |  |  |  |  | i
 |  |  |  |  |  |  |  |  |  |  |  |  |  | i
 |  |  |  |  |  |  |  |  |  |  |  |  |  | i
 |  |  |  |  |  |  |  |  |  |  |  |  | A |  | 56
 |  |  |  |  |  |  |  |  |  |  |  |  | Z |  | 8
 |  |  |  |  |  |  |  |  |  |  |  |  | X | d | 8
 |  |  |  |  |  |  |  |  |  |  |  |  | 567 |  | p