Thread: If formula
View Single Post
  #2   Report Post  
Posted to microsoft.public.word.tables
Stefan Blom Stefan Blom is offline
external usenet poster
 
Posts: 8,428
Default If formula

In the field properties, choose the "Calculate on exit" option. Then create
fields as follows:

{ SET test1 { = { Text32 } + { Text37 } } }

{ SET test2 { = { Text 42 } + { Text 47 } } }

{ IF { test1 } = { test2 } "Ok" "{ = { test1 } - { test2 } }" }

To insert each pair of field delimiters, { }, press Ctrl+F9. When you are
done, press F9 to update. Finally, protect the document again and try the
code.

In an unprotected document, you can show/hide field codes by pressing
Alt+F9.

--
Stefan Blom
Microsoft Word MVP


"Duncan" wrote in message
...
Hi

I hope someone out there can help me?

I am using the TextForm field button within my doc.
Under the "Properties" of each field, the "Bookmark" is Text32, Text37,
Text42 and Text47

I am trying (and failing) to add a new field that will perform a
calculation
based on the fields named above.

What I want the calculation to do is as follows:

If (Text32 + Text37) = (Text42 + Text47) then "Ok" else ((Text32 +
Text37)-(Text42 + Text 47))

Can anyone please point me in the right direction?

Thanks in advance.