Google表格有多个查询匹配的单词和数字

时间:2019-07-02 15:01:25

标签: regex google-sheets google-sheets-formula google-sheets-query google-query-language

我需要查询Google表格中的表格,以查找值大于指定数字的多个单词的匹配项。

例如,我想在看起来像这样的工作表中找到所有包含“花园”或“门”且值大于“ 30”的单词:

enter image description here

我有这个公式,但是不起作用:

=QUERY(Sheet1!A:B,"select * where A contains 'garden' OR A contains 'gate' AND B>30 ")

2 个答案:

答案 0 :(得分:2)

=QUERY(Sheet1!A:B, 
 "where B > 30 
    and (A contains 'garden' 
     or  A contains 'gate')", 0)

0


=QUERY(Sheet1!A:B, 
 "where A matches '.*garden.*|.*gate.*' 
    and B > 30", 0)

答案 1 :(得分:1)

请尝试:

=QUERY(Sheet1!A:B,"where  B > 30 and (A like '%garden%' OR A like '%gate%')")