[英]Conditional Formatting in Excel selecting wrong rows when trying to highlight cells greater than 15
I am attempting to highlight cells that are greater than 15. But it's highlighting all of the cells in the row.我试图突出显示大于 15 的单元格。但它突出显示了行中的所有单元格。 I have a formula in the row so I do not know if that is messing with it.我在行中有一个公式,所以我不知道这是否弄乱了它。 The formula is:公式为:
=IFERROR(IF(E7="","0", IF(NETWORKDAYS(E7,O7,MenuData!$G$3:$G$22)<0, "0", (NETWORKDAYS(E7,O7,MenuData!$G$3:$G$22)-1))),0)
I select the entire column that I want to apply the conditional formatting, select highlight cell rules.> greater than > and then put for it to select cells greater than 15 and to highlight them red.我选择要应用条件格式的整个列,选择突出显示单元格规则。> 大于 > 然后让它选择大于 15 的单元格并将它们突出显示为红色。 It then highlights everything greater than 15 but also selects the zeros that are 0 due to the if/iferror statements in the formula.然后它会突出显示大于 15 的所有内容,但也会选择由于公式中的 if/iferror 语句而为 0 的零。 Is there something wrong with my formula?我的公式有问题吗?
Here is what the column looks like once the conditional formatting is applied:以下是应用条件格式后该列的外观:
Welcome to SO.欢迎来到 SO。 Excel always treats text values as being greater than any number, for example: Excel 始终将文本值视为大于任何数字,例如:
="a">9999999999 -> TRUE
As your formula doesn't return a true zero 0
, but a zero text value "0"
, the logic is still the same:由于您的公式不返回真正的零0
,而是零文本值"0"
,逻辑仍然相同:
="0">9999999999 -> TRUE
You can either adjust your original Excel formula to return a numerical 0
, eg =IFERROR(IF(E7="",0,...
, or adjust your Conditional Formatting to apply only to numerical values, eg =AND(ISNUMBER(H4),H4>15)
您可以调整原始 Excel 公式以返回数字0
,例如=IFERROR(IF(E7="",0,...
,或者调整您的条件格式以仅适用于数值,例如=AND(ISNUMBER(H4),H4>15)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.