Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / August 2007

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
tddrover - 17 Aug 2007 01:48 GMT
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?
Herb Tyson [MVP] - 17 Aug 2007 04:16 GMT
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.

Signature

Herb Tyson MS MVP
Author of the Word 2007 Bible
Blog: http://word2007bible.herbtyson.com
Web: http://www.herbtyson.com

>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 =
[quoted text clipped - 3 lines]
> to
> read in a dollar format instead of decimal format.  Can anyone help?
Doug Robbins - Word MVP - 17 Aug 2007 04:18 GMT
{ = ({ MERGEFIELD Original Debt } - { MERGEFIELD Paid to Date }) / 2 \#
"$,0.00" }

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

Signature

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

>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 =
[quoted text clipped - 3 lines]
> to
> read in a dollar format instead of decimal format.  Can anyone help?
tddrover - 17 Aug 2007 15:08 GMT
Thank you very much!! Worked great.

> 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?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.