#1
|
||||
|
||||
Syntax Error in computed field
Following the instructions that I found, I wanted to get an approximate word count (rounded to 100), so I put in the suggested formula,
Code:
Approximately {=ROUND({NUMWORDS},-2) \# ,0,} words Code:
Approximately!Syntax Error, {words Various attempts including the very detailed document on expressions in Word (Word Field Maths V1_5.doc) did not clarify this problem. So I went back and just replaced the field. I selected the format #,##0, as a number, and got Code:
NUMWORDS \# "#,##0" \* Arabic \* MERGEFORMAT Code:
Approximately 3107 words instead of the expected Code:
Approximately 3,107 words Last edited by newcomer@flounder.com; 09-18-2023 at 08:33 PM. Reason: Did not get comma on second attempt, so added that |
#2
|
||||
|
||||
try this
{=Round({Numwords},-2) \# "#,##0"}
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#3
|
||||
|
||||
Didn't work
Same syntax error message
|
#4
|
||||
|
||||
It works on my M365 machine.
Did you insert both sets of the {parentheses} by using Ctrl-F9?
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#5
|
||||
|
||||
If I add {} around the body,
Code:
Approximately { Code:
{=Round({Numwords},-2) \# "#,##0"} } words Code:
Approximately { Code:
{{=Round({Numwords},-2) \# "#,##0"}} } words Code:
Approximately words Code:
Approximately { Code:
=Round({Numwords},-2) \# "#,##0" } words (For reasons I do not understand, a gratuitous end-CODE, start-CODE pair are added each time I save this, right after the open brace, which results in really stupid-looking output. I've tried three times to fix it, and the bugs in the editor seem to be permanent) Last edited by newcomer@flounder.com; 09-19-2023 at 01:02 AM. Reason: Adding text for the failing examples |
#6
|
||||
|
||||
see attached doc
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#7
|
|||
|
|||
Look at the field in Andrew's document. You cannot simply type the { } field delimiters; Word must put them in, in pairs.
|
Tags |
fields, fields word functions |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
What is the syntax error with .Text "^p" ? | Tom1956 | Word VBA | 5 | 09-21-2020 09:24 PM |
Syntax error on formula that works in spreadsheet | Mxthomp | Excel Programming | 1 | 11-02-2016 06:49 PM |
Mail Merge Field - Trying to divide time however receiving !Syntax, ; | Jake0254 | Mail Merge | 1 | 09-24-2014 12:58 AM |
Error handling in formula - suppress 'Syntax Error' | Cosmo | Word | 7 | 02-24-2014 07:08 AM |
Using multiple formulas in one (IF, AND and SUM) gives syntax error | markdeniet | Word | 1 | 02-05-2014 05:17 AM |