简体   繁体   English

Excel - 条件格式 - 单元格不为空,等于0

[英]Excel - Conditional Formatting - Cell not blank and equals 0

I'm trying to check if a cell is: 我正在尝试检查一个单元格是否:

  1. blank, and if false (not blank) 空白,如果为假(不是空白)
  2. If value equals 0. I have tried: 如果值等于0.我试过:

    =IF( NOT( ISBLANK($D:$D) ) & $D:$D=0 ,TRUE,FALSE) = IF(NOT(ISBLANK($ D:$ D))&$ D:$ D = 0,TRUE,FALSE)

    =IF( AND( NOT( ISBLANK($D:$D) ),$D:$D=0) ,TRUE,FALSE) = IF(AND(不(ISBLANK($ D:$ D)),$ D:$ D = 0),TRUE,FALSE)

I am use Excel 2013 with Conditional Formatting rule: Use a formula to determine which cells to format > Format values where this formula is true 我使用带有条件格式规则的Excel 2013使用公式确定要格式化的单元格 > 格式化此公式为true的值

What am I doing wrong? 我究竟做错了什么? The problem is, the IF($D:$D=0) recognises cells with value 0 and those which are blank as true . 问题是, IF($D:$D=0)识别值为0的单元格和空白true的单元格 I only want it to recognise 0 values. 我只想让它识别0值。 Not blank. 不是空白。

I think this is what you're looking for: 我想这就是你要找的东西:

=AND(COUNTBLANK($D1)=0,$D1=0)

Note that when you apply it to the whole column, each cell will only look at its respective row. 请注意,将其应用于整个列时,每个单元格只会查看其各自的行。 You'll want to keep the reference of $D1 instead of using $D:$D 你想要保留$ D1的引用,而不是使用$ D:$ D.

您也可以使用此公式

=($D1<>"")*($D1=0)

Before the rule specifying "0" you should add the rule "cell contains empty (blank) value". 在规则指定“0”之前,您应该添加规则“单元格包含空(空白)值”。 Then set the format to "no formatting" and then select "stop if true". 然后将格式设置为“无格式化”,然后选择“如果为true则停止”。

以下内容将起作用,您不必担心AND和NOT如何组合在一起。

=IF(ISBLANK(A1),TRUE,IF(A1=0,TRUE,FALSE))

format only cells that contains -> (Specific text)... Don't use (cell value)--> then type "0" with no quotation marks 格式化仅包含 - >(特定文本)的单元格...不使用(单元格值) - >然后键入“0”,不带引号

this will format only cells with 0 inside it, blank cells will not be formatted 这将只格式化其中包含0的单元格,不会格式化空白单元格

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如果此当前单元格为空白,则使用Excel条件格式公式 - Excel conditional formatting formula if THIS current cell is blank Excel条件格式:如果单元格不为空白,则将边框添加到行? 但是忽略公式吗? - Excel Conditional Formatting: Add border to row if cell not blank? But ignore formula? Excel 条件格式 - 忽略第一个单元格为空白的行 - Excel Conditional Formatting - Ignore rows with blank first cell 带有第二个空白单元格的条件格式 - Conditional Formatting with second blank cell Excel 中的单元格条件格式 - Cell by cell conditional formatting in Excel Excel - 条件格式以突出显示单元格值是否等于并且另一个单元格值早于日期 - Excel - Conditional Formatting to highlight if cell value equals and another cell value is before date Excel 如果 A 列中的单元格和 B 列中的单元格为空白而不是 G 列中的突出显示单元格,则条件格式 - Excel Conditional Formatting if cell in Column A AND the cell in Column B are blank than highlight cell in Column G Excel条件格式-如果此复制此单元格 - Excel Conditional Formatting - IF this copy this cell 在单元格与辅助单元格上的excel条件格式 - excel conditional formatting on cell versus adjecant cell VBA Excel:将条件格式应用于空白单元格 - VBA Excel: Apply conditional formatting to BLANK cells
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM