WD: Syntax Error in Formula Field That Uses Comma Separator

Last reviewed: February 3, 1998
Article ID: Q118516
The information in this article applies to:
  • Microsoft Word for Windows, versions 2.0, 2.0a, 2.0a-CD, 2.0b, 2.0c, 6.0, 6.0a, 6.0c
  • Microsoft Word for Windows 95, version 7.0
  • Microsoft Word 97 for Windows
  • Microsoft Word for the Macintosh, versions 6.0, 6.0.1
  • Microsoft Word 98 Macintosh Edition

SYMPTOMS

When using a formula or expression field to perform a calculation of a set of numbers, you may receive the following error message

   !Syntax Error, xxx,xxx

where xxx represents the numbers in the argument.

This error occurs when two or more numbers are separated by a comma without a space and the second and subsequent numbers are three or more digits. For example, the following expressions

   {=sum(123,123)}
   {=sum(123,123,123)}

will produce these errors, respectively:

   !Syntax Error, 123,123
   !Syntax Error, 123,123,123

This behavior occurs when the formula field performs the following calculations: SUM, AVERAGE, MIN, MAX, and PRODUCT.

If the expression contains a series of three or more numbers, the second number is one or two digits, and each number is separated by a comma without a space, your results will be inaccurate, and you will not get a syntax error. For example, the following expression

     {=sum(1,22,222,222)}

will produce the following result:

     22,222,223

This behavior does not occur when you perform calculations based on table cell references or when using bookmarks.

CAUSE

When the comma is not followed by a space but is followed by three digits, Word interprets the comma as being the thousands-place separator and treats the argument as one number.

STATUS

Microsoft has confirmed this to be a problem in Word versions listed above. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

RESOLUTION

Place a space immediately following the comma, so that your formula looks like.

   {=SUM(123, 125)}


Additional query words: winword2 field codes average maximum sum product
minimum syntax error winword errors table tables calculate formula
incorrect wrong
Keywords : kbfield macword winword word6 word7 word95 word97
Version : MACINTOSH:6.0,6.0.1,6.0.1a,98;WINDOWS:2.0,2.0a,2.0a- CD,2.0b,2.0c,6.0,6.0a,6.0c,7.0,7.0a,97
Platform : MACINTOSH WINDOWS
Issue type : kbbug
Solution Type : kbworkaround


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