Microsoft KB Archive/95618

-

{| The information in this article applies to:
 * width="100%"|
 * Microsoft Word for Windows, versions 2.0, 2.0a, 2.0a-CD, 2.0b, 2.0c

SYMPTOMS
If you use an expression (=) field in a Word for Windows table to divide the sum of one cell by another cell that contains no value (null value), the result of the expression field yields the following error:

! Zero Divide This error occurs whenever you try to divide by a null value.

WORKAROUND
Word generates this error because it is not possible to divide a number by zero or nothing. If you prefer to display a different error message, use the following IF statement instead of the original expression field:

{IF{=sum([r2c1])}<>&quot;0&quot; &quot;{=sum([r1c1])/sum([r2c1])}&quot; &quot;You can't divide by zero.&quot;} This field does the following: If the sum of r2c1 (row 2, column 1) is not equal to zero, then divide r1c1 by r2c1. If r2c1 is equal to zero, then display the message &quot;You can't divide by zero.&quot;

NOTE: You can use any text in place of the &quot;You can't divide by  zero&quot; error message. You can leave the prompt argument blank (&quot;&quot;) if do not want an error message to appear in the cell.