简体   繁体   English

尝试突出显示大于 15 的单元格时,Excel 中的条件格式选择错误的行

[英]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.

相关问题 Excel条件格式-突出显示大于 - Excel-Conditional Formatting- Highlight the difference that is greater than Excel条件格式 - 突出显示大于5的数字但忽略任何公式 - Excel conditional formatting - Highlight numbers greater than 5 but ignore any formula 使用Excel VBA条件格式时如何突出显示单元格? - How to highlight cells when using Excel VBA conditional formatting? Excel条件格式-突出显示之间的空白单元格 - Excel Conditional Formatting - Highlight blank cells between Excel条件格式:如果不相等,则突出显示单元格 - Excel Conditional Formatting: Highlight cells if not equal 通过条件格式计算彩色单元格(大于/小于) - Count colored cells by conditional formatting (greater than/lesser than) Excel条件格式 - 根据每列顶部的值突出显示单元格 - Excel conditional formatting - highlight cells based on a value at the top of each column Excel-根据其他突出显示的单元格使用条件格式突出显示单元格 - Excel - Highlight a cell using conditional formatting based on other cells that are highlighted Excel条件格式:多行匹配时突出显示重复项 - Excel Conditional Formatting: Highlight Duplicates When More than One Row Matches 突出显示多个单元格用于excel条件格式 - highlight more than one cell for excel conditional formatting
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM