如何过滤视图两列 OR 而不是 AND?

How do I filter view two columns OR instead of AND?

在 Google 表格中,我想过滤查看我的结果,以便仅显示 D 列 AND/OR E 列中具有 "x" 的行。如果我过滤以显示其中带有 "x" 的列,它只会显示 D 列和 E 列中带有 "x" 的行。

如何实现 AND/OR?当我单击列中的过滤器按钮时,它只是询问我 select 我想显示哪些条目。

  • 单击 D 列。
  • 在菜单上单击 'Data'。
  • Select 'Create a filter'.
  • 单击出现在 D 列顶部的过滤器图标。
  • Select 'Filter by condition'.
  • 单击 'None' 框并向下滚动到 'Custom formula is'。
  • Select 并在值或公式中输入 =OR(D:D="x",E:E="x")
  • 单击“确定”。

或者,您可以创建一个新的 sheet 并在 A1 中输入 =FILTER(Sheet1!A:E,(Sheet1!D:D="x")+(Sheet1!E:E="x"))。根据需要调整列。

您还可以使用 QUERY 公式,例如:

=QUERY(A:E; "where D='x' or E='x'"; 0)

=QUERY(A:E; "where D='x' and E='x'"; 0)

要使其不区分大小写,您可以使用 lower,例如:

=QUERY(A:E; "where lower(D)='x' or lower(E)='x'"; 0)

=QUERY(A:E; "where lower(D)='x' and lower(E)='x'"; 0)

如果您想为 1 列使用交替值,您可以使用:

=QUERY(A:E; "where D matches 'x|y'"; 0)