Microsoft Office Tutorials and References

In Depth Information

Because Excel considers a blank cell to be zero, you also get this error if your formula divides by a missing

value. This problem is common when you create formulas for data that you haven't entered yet, as shown in

Figure 22-2. The formula in cell D4, which was copied to the cells below it, is as follows:

=C4/B4

Figure 22-2:
#DIV/0! errors occur when the data in column B is missing.

This formula calculates the ratio of the values in columns C and B. Data is not available for all days, so the for-

mula returns a #DIV/0! error.

To avoid the error display, you can use an IF function to check for a blank cell in column C:

=IF(B4=0,””,C4/B4)

This formula displays an empty string if cell B4 is blank or contains 0; otherwise, it displays the calculated

value.

Another approach is to use the IFERROR function to check for
any
error condition. The following formula, for

example, displays an empty string if the formula results in any type of error:

=IFERROR(C4/B4,””)