Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Mergefield calculation

Mergefield calculation

Mergefield calculation


I encounter a syntax error in deducting «Total» to «TotalTax». Is there a way to just divide the «Total» by 1.05 or 105%?

I just need this formula in my invoice form using office365.

Soon to hear reply from you.


RE: Mergefield calculation

You can use either approach. What is the formula that's giving you problems? Do note that you're liable to see '!Syntax Error' in the mailmerge main document unless you're previewing the output and, even then, you may continue to see such errors until you complete the merge.

To see how to do this a wide range of calculations in Word, check out my Microsoft Word Field Maths Tutorial, at:

See also my Mailmerge Tips and Tricks thread at: http://www.msofficeforums.com/mail-merge/21803-mai...

Paul Edstein
[MS MVP - Word]

RE: Mergefield calculation

That's as simple as a formula field coded as:
{={MERGEFIELD Total}-{MERGEFIELD TotalTax} \# ",0.00;(,0.00)"}
{={MERGEFIELD Total}+{MERGEFIELD TotalTax} \# ",0.00;(,0.00)"}
depending on whether TotalTax is a +ve or -ve value.

Note: The field brace pairs (i.e. '{ }') for the above example are all created in the document itself, via Ctrl-F9 (Cmd-F9 on a Mac or, if you’re using a laptop, you might need to use Ctrl-Fn-F9); you can't simply type them (which is what you've done in some cases in your document) or copy & paste them from this message. The spaces represented in the field constructions are all required.

You can probably also lose all the \* MERGEFORMAT switches in your mailmerge main document - they're unlikely to be contributing anything other than clutter.

Paul Edstein
[MS MVP - Word]

RE: Mergefield calculation

Hi Macropod,

I created below formula on my template but still having a Syntax error. If it is successfully created, what would be the default value on the forms.

{={MERGEFIELD Total}-{MERGEFIELD TotalTax} \# ",0.00;(,0.00)"}


RE: Mergefield calculation

Unless you ignored the Note in my previous reply, I cannot see how a syntax error is possible. The field code as posted works just fine on my system.

Paul Edstein
[MS MVP - Word]

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close