×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• 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.

# Mergefield calculation

## Mergefield calculation

(OP)
Hi,

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.

Thanks,
KC

### 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:
http://www.msofficeforums.com/word/38720-microsoft...
or:

Cheers
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)"}
or:
{={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.

Cheers
Paul Edstein
[MS MVP - Word]

### RE: Mergefield calculation

(OP)
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)"}

Regards,
Kc

### 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.

Cheers
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.

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:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!