简体   繁体   English

使用两个“where”条件优化查询公式

[英]Refining a Query formula with two 'where' conditions

I need to write a Query formula to pull through unique values from another sheet, excluding rows that contain certain keywords and also excluding any empty rows.我需要编写一个查询公式来从另一张表中提取唯一值,排除包含某些关键字的行,还排除任何空行。

I've written this formula:我写了这个公式:

=UNIQUE(QUERY('Sheet Name':A1,AZ,"Select A where A is not null and where not A contains 'STRING'",1)) =UNIQUE(QUERY('Sheet Name':A1,AZ,"选择 A,其中 A 不是 null 且 A 不包含'STRING'",1))

Unfortunately this gives a VALUE error.不幸的是,这会产生一个 VALUE 错误。 It works with either of the 'where' clauses but not with both.它适用于“where”子句中的任何一个,但不适用于两者。

What am I missing?我错过了什么?

You don't need to add the seconde 'Where', it just implies that you continue to add conditions into that statement:您不需要添加第二个“Where”,它只是暗示您继续在该语句中添加条件:

=UNIQUE(QUERY('Sheet Name'!A1:AZ,"Select A where A is not null and not A contains 'STRING'",1))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM