google sheets 中common headers 的两个表如何合并?

How to combine two tables with common headers in google sheets?

我正在尝试合并两个具有共同 headers 的表。如果我定义了确切的开始和结束行,下面的公式才能正常工作。我如何调整下面的公式以从两个表中动态获取非空行。

=iferror({A1:C50;ArrayFormula(hlookup(A1:C1,'Settings'!A1:C50,row(A2:A50),0))})

示例输入:

Table 1

col 1 col2 col 3
abc 123 789
def 456 1212

Table 2

col 1 col2 col 3
abc 123 78849
jkl 256 1298

期望的输出:

Table 3

col 1 col2 col 3
abc 123 789
def 456 1212
abc 123 78849
jkl 256 1298

使用OUERY:

=QUERY({A1:C1;A2:C;E2:G},"WHERE Col1 IS NOT NULL")