如何按行值查询电子表格

How to QUERY a Spreadsheet by Row value

我的电子表格中有这样一个 table

FEB  MAR  APR  MAY
 10   14    7   13
 12    9    8   19
 15   11   14   16

我想在另一个 table 中使用此信息。我想要完成的是另一个 table 通过获取带有月份名称的信息来比较两个月。

FEB  APR
 10   7
 12   8
 15  14

我做的是

=QUERY(AnotherTable!1:1001; "SELECT * WHERE Row2 = 'FEB'")

但似乎没有用。

有什么想法吗?

您或许可以改用 FILTER 公式:

=FILTER(AnotherTable!1:1001;AnotherTable!2:2="FEB")

或return两个月:

=FILTER(AnotherTable!1:1001,((AnotherTable!2:2="FEB")+(AnotherTable!2:2="APR")))

两次使用TRANSPOSE内置函数,第一次翻转源数据,第二次翻转结果,而不是引用行,公式应该引用列。

结果公式为

=TRANSPOSE(QUERY(TRANSPOSE(A:D),"Select * where Col1='FEB' OR Col1='APR'"))

将上述公式应用于以下源数据

FEB  MAR  APR  MAY
 10   14    7   13
 12    9    8   19
 15   11   14   16

会return下面的结果

FEB  APR
 10   7
 12   8
 15  14