布局不同时如何从 2 个范围进行查询?

How to make a query from 2 ranges when the layout are different?

我有一个sheet demo

我想做的是从 2 个范围进行查询,但范围有不同的布局,在 Sheet1 国家是 col M,而 sheet2 国家是 col N。

那么当布局不同时如何从 2 个范围进行查询?

而且我还想在查询结果中添加一列以具有 sheet 名称以了解数据的来源。

我有一个名为查询的选项卡。

=QUERY({{Sheet1!A2:K,Sheet1!K2:K,Sheet1!L2:Q};Sheet2!A2:R},
 "select Col13,count(Col15) 
  where Col13<>'' and not Col13 contains 'Otro' 
  group by Col13 order by count(Col15) desc 
  limit 17 label Col13 'Pais' ", 1)