WinWord Err Msg: '! Zero Divide' When Using Expression Field

Last reviewed: July 30, 1997
Article ID: Q95618
The information in this article applies to:
  • 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])}<>"0" "{=sum([r1c1])/sum([r2c1])}" "You
   can't divide by zero."}

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 "You can't divide by zero."

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

REFERENCES

"Microsoft Word for Windows User's Guide," version 2.0, pages 307-309


KBCategory: kbusage
KBSubcategory: kbfield
Additional query words: 1.0 1.10 1.10a 2.0 2.0a 2.0a-CD 2.0b
winword2 winword 2.0c !Zero blank calculation math errmsg err msg
Version : 2.0 2.0a 2.0a-CD 2.0b 2.0c


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: July 30, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.