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 / January 2008

Tip: Looking for answers? Try searching our database.

Possible to calculate from a cell?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JAnderson - 25 Jan 2008 00:53 GMT
I'm very familiar with Excel, but not very much with Word and its Merge fields.

I want to use a calculated value in several places, based on the contents of
merge fields.  Example:

Subtotal:    (Merge field A)
Tax:          (Merge field B)
Shipping:   (Merge field C)
TOTAL:      (SUM of all 3 fields)

So, the question is whether I can have a cell where I can sum all 3 fields,
and whether I can reference that "TOTAL" field in another few places in the
document (rather than recalculating each time).

Thanks for any suggestions!
Doug Robbins - Word MVP - 25 Jan 2008 05:31 GMT
Use the formula

{ = { MERGEFIELD A } + { MERGEFIELD B } + { MERGEFIELD C } }

You must use Ctrl+F9 to insert each pair of field delimiters { }, and you
may also want to add a formatted switch.

See "Formatting Word fields with switches" on fellow MVP Graham Mayor's
website at

http://www.gmayor.com/formatting_word_fields.htm

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'm very familiar with Excel, but not very much with Word and its Merge
> fields.
[quoted text clipped - 15 lines]
>
> Thanks for any suggestions!
JAnderson - 25 Jan 2008 16:33 GMT
That makes sense, thank you.  Now, what if each Merge field is itself
determined by an if statement?  Here's a simplified example ignoring
formatting for now (also, is it required to end formatting switches with "\*
MERGEFORMAT" or is that something Word puts in unnecessarily?):

Subtotal: {if {MERGEFIELD A} = "Widget" "300.00" "150.00"}
Tax: {if {MERGEFIELD B} = "Ohio" "20.00" "0.00"}
Shipping: {if {MERGEFIELD C} = "Ohio" "20.00" "0.00"}

TOTAL: ????? (Normally I would just nest all 3 of the above IF statements,
but there must be a better way).

Any ideas?

> Use the formula
>
[quoted text clipped - 27 lines]
> >
> > Thanks for any suggestions!
Graham Mayor - 26 Jan 2008 09:12 GMT
How about

{ SET TA  { if { MERGEFIELD A } = "Widget" "300.00" "150.00" } }{ SET TB
{ if { MERGEFIELD B } = "Ohio" "20.00" "0.00" } }{ SET TC  { if { MERGEFIELD
C } = "Ohio" "20.00" "0.00" } }
Subtotal: { REF TA \# "$,0.00" }
Tax: { REF TB \# "$,0.00" }
Shipping: { REF TC \# "$,0.00" }
TOTAL: { ={REF TA  } + { REF TB } + { REF TC } \# "$,0.00" }

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

> That makes sense, thank you.  Now, what if each Merge field is itself
> determined by an if statement?  Here's a simplified example ignoring
[quoted text clipped - 50 lines]
>>>
>>> Thanks for any suggestions!
Peter Jamieson - 30 Jan 2008 17:54 GMT
<<
also, is it required to end formatting switches with "\*
MERGEFORMAT"

No it isn't.

<<
or is that something Word puts in unnecessarily?):

Yes, although I suspect MS thinks inserting it results in a better
experience on average for most users and they may be right.

Signature

Peter Jamieson
http://tips.pjmsn.me.uk

> That makes sense, thank you.  Now, what if each Merge field is itself
> determined by an if statement?  Here's a simplified example ignoring
[quoted text clipped - 43 lines]
>> >
>> > Thanks for any suggestions!
 
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.