【问题标题】:Conditional formatting not working with 'countif' function in Google Sheets条件格式不适用于 Google 表格中的“countif”功能
【发布时间】:2017-10-30 13:00:38
【问题描述】:

我正在尝试在 Google 表格的条件格式规则中应用一个简单的自定义公式,但它对我不起作用,我不明白为什么。

我有两张床单。第一张表包含一系列行,以 id 开头:

ID
50013   50  13  Member of the City Council  3   4
50082   50  82  Member of the City Council  3   62
50083   50  83  Member of the City Council  3   130

然后我的第二张表包含另一个类似的行列表,它是第一张表中行的子集。我要做的是突出显示第一张表中“ID”字段(如上所示)在第二张表的子集中的行。

我尝试使用的规则是:

countif('Bernie Intersect 1'!$A$2:$A$22, A2)

但是当我将它放入条件格式条件字段时,我没有得到想要的结果。我看不到输出,但显然该字段没有返回 TRUE...

我认为我可能需要在表达式前面添加一个=,但如果我添加它,我会收到一个错误,即公式无效。

有谁知道我在这里可能做错了什么?

【问题讨论】:

  • 您需要=。至于为什么公式无效,请分享您的工作表或重现错误的示例
  • @anonymousrabbit 无效,因为它引用了条件格式规则中的另一个工作表。

标签: google-sheets spreadsheet


【解决方案1】:

条件格式公式不允许显式引用其他工作表。使用indirect 绕过此限制:

=countif(indirect("'Bernie Intersect 1'!A2:A22"), $A2)

indirect 没有必要说 A2:A22 是绝对引用,因为无论如何它们都是字符串格式;在indirect 内,一切都是绝对的。

【讨论】:

    猜你喜欢
    • 2018-12-07
    • 2015-10-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-02-22
    • 2012-05-07
    • 1970-01-01
    相关资源
    最近更新 更多