Excel: Suppressing #DIV/0! Error Messages in Division

Last reviewed: November 2, 1994
Article ID: Q48165
Summary

When dividing by 0 (zero) or a blank cell, Microsoft Excel displays the error message "#DIV/0!". To keep this error message from appearing, use the following formula in place of the standard division formula:

   =IF(denominator=0,"",numerator/denominator)

Numerator refers to the cell to be divided. Denominator refers to the cell that is the divisor.

This formula checks to see if the denominator equals zero (or is blank); if so, a blank cell is displayed.

For example, if you want to divide cell A1 by cell A2 and put the result in cell A3, the formula in cell A3 would be:

   =IF(A2=0,"",A1/A2)

Cell A3 will appear blank if cell A2 is blank or contains a zero. Otherwise, A3 will contain the result of the formula A1/A2.

MORE INFORMATION

To display other information in the cell, type the necessary information in the formula where the "" (quotation marks) are between the two commas. If you want to display text, type it between these quotation marks. If you want to display anything else (values), type it in place of the quotation marks.

Note: If the denominator is a nonzero value, the division is calculated.


KBCategory: kbother
KBSubcategory:

Additional reference words: 1.00 1.03 1.04 1.06 1.50 2.20 3.00


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 2, 1994
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.