Formula to Correctly Evaluate Blank Cells

Article translations Article translations
Article ID: 149577 - View products that this article applies to.
This article was previously published under Q149577
Expand all | Collapse all

SUMMARY

In Microsoft Excel, when you use a formula that tests for a zero value, you may see unexpected results if the cell is blank. Microsoft Excel interprets a blank cell as zero, and not as empty or blank. Therefore, any cells that are blank are evaluated as zero in the function.

MORE INFORMATION

If you are checking a cell for a zero value and the cell is blank, the test evaluates to true. For example, if you have the following formula in cell A1:
   =IF(B1=0,"zero","blank")
				
and B1 is blank, the formula returns "zero" and not "blank" as expected.

If the range might contain a blank cell, you should use the ISBLANK function to test for a zero value, as in the following example:
   =IF(ISBLANK(B2),"blank",IF(B2=0,"zero","other"))
				
Note that the above formula returns "zero" if there is a zero value in the cell, "blank" if the cell is blank, and "other" if anything else in the cell.

You must always use the ISBLANK formula first before you test for a zero value, otherwise you will always return a "true" for the zero value, and never get to the test for the ISBLANK formula.

Properties

Article ID: 149577 - Last Review: August 15, 2003 - Revision: 1.1
APPLIES TO
  • Microsoft Excel 5.0c
  • Microsoft Excel 5.0 Standard Edition
  • Microsoft Excel 4.0c
  • Microsoft Excel 4.0a
  • Microsoft Excel 4.0 Standard Edition
  • Microsoft Excel 5.0a for Macintosh
  • Microsoft Excel 5.0 for Macintosh
  • Microsoft Excel 4.0 for Macintosh
Keywords: 
kbinfo KB149577
Retired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com