如何根据单独列中的值对 table 进行条件格式化?

How to do conditional formatting for a table based on values in separate columns?

我有一个 table,我试图根据一列中的空白单元格和另一列中的值突出显示每一行。我希望每一行在 K 列中查找一个空白单元格,在 C 列中查找一个值为 10 的值。长格式解释是:如果 K 列中的单元格为空白,并且 C 列中的单元格为 10,则突出显示整行.

这是我能想到的,但它突出显示了随机行,所以我知道它已关闭:=AND($K2="",$C2="10")

我也不确定要 select 那个范围,我 select 编辑了整个 table

谢谢!

C 列中的值是一个数字,因此您不需要 " 标记

您可以将此自定义公式应用于整个 sheet。行引用是相对的,这意味着它将依次检查从第 1 行开始的每一行。

=AND($K1="",$C1=10)

你可以使用这个:

范围: A1:O

自定义公式:

=AND($K1="",VALUE($C1)=10)=AND($K1="",$C1="10")

输出:

Not sure why, but your Column C value was eveluated as a text and not a number. To make some workarounds, I used VALUE() to convert text/string to a number first before comparing.

Please make sure not to remove $ in the formula. It is important to lock the columns to K and C and just increment the row number. If the $ is not included, conditional formatting will loop all rows and columns in the given range

注意:

您的公式最初失败的原因是因为它与您的范围不匹配。由于您的范围从第 1 行开始,因此您的公式也应从第 1 行开始。

在您的初始配置中发生的事情是,当检查第 1 行是否应突出显示时,它会检查 K2 和 C2 中的值,依此类推....