How do I subtract two merge fields then take that total and divide

T

tddrover

I want to take my two merge field and divide them by 50% or by two. I can
get the subtracting part but it does not want to divide. I tried {total =
{Mergefield Original Debt} - {Mergefield Paid to Date} / 2} this will only
give me the subtraction but not the division part. Also I want the answer to
read in a dollar format instead of decimal format. Can anyone help?
 
H

Herb Tyson [MVP]

Use parentheses so that Word knows to divide the difference:

{ = ({Mergefield Original Debt} - {Mergefield Paid to Date}) / 2}

As shown in your example (not sure why "total" is there -- it should not be,
and it's likely changing the result), it's doing the following:

OriginalDebt - (PaidToDate/2)

That's because multiplication is evaluated before subtraction. By grouping
using parentheses, you can control how the expression is evaluated.
 
D

Doug Robbins - Word MVP

{ = ({ MERGEFIELD Original Debt } - { MERGEFIELD Paid to Date }) / 2 \#
"$,0.00" }

You must use Ctrl+F9 for each pair of Field Delimiters { }

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top