Microsoft KB Archive/118516

= WD: Syntax Error in Formula Field That Uses Comma Separator =

Article ID: 118516

Article Last Modified on 8/16/2005

-

APPLIES TO


 * Microsoft Word 2.0 Standard Edition
 * Microsoft Word 2.0a
 * Microsoft Office Word 2003
 * Microsoft Word 2.0c
 * Microsoft Word 6.0 Standard Edition
 * Microsoft Word 6.0a
 * Microsoft Word 6.0c
 * Microsoft Word 95 Standard Edition
 * Microsoft Word 6.0 for Macintosh
 * Microsoft Word 6.01 for Macintosh
 * Microsoft Word 98 for Macintosh

-



This article was previously published under Q118516





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 the following errors:

!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 that this is a problem in the Microsoft products that are listed at the beginning of this article.



RESOLUTION
Place a space immediately following the comma, so that your formula looks as follows:

{=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: kbbug kbfield KB118516

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.