如何根据条件过滤掉数据

How to filter out data based on a condition

我有一份志愿者总名单。我需要另一份志愿者名单,其中包括他们的信息,只要他们没有被选为不活跃的。如果他们现在正在联系,请稍后联系,新注册,甚至没有数据。如果它说不活动,我不想在我的第二个工作表中使用它们。就这样。

这是电子表格

https://docs.google.com/spreadsheets/d/1c075Gervxl0fzZISswhyQ2Z8g61TZhS8IGvl1EEK2o0/edit?usp=sharing

您可以使用 query() 函数:

=query('Master Volunteer List'!A:I,"Select * where G = ''")

或者您可以使用 filter() 函数:

=filter('Master Volunteer List'!A2:I,'Master Volunteer List'!G2:G = "")

过滤器函数不会选取 header 行。所以你需要

  1. filter() 函数放在单元格 A2
  2. 并手动填充 A1:G1 中的 header 行

使用这个查询公式:

=QUERY('Master Volunteer List'!A:I, "where not G = 'y'", 1)


您甚至可以像这样删除非活动列:

=QUERY('Master Volunteer List'!A:I, "select A,B,C,D,E,F,H,I where not G = 'y'", 1)