Group:  Microsoft Word ยป microsoft.public.word.mailmerge.fields
Thread: Perform mathematical calculations with merge fields

Geek News

Perform mathematical calculations with merge fields
cjlatta 5/23/2007 7:30:01 PM
I have a letter that we created in Word 2000 that I need to update. I can't
open the document in Word 2003, so I'm recreating it. The document contains
several merge fields. I want to perform a multiplication of a merge field
(which is a number) by a set number (in the example it's 35). I used the
{=35*{mergefield xxx}\#,0.00\*Mergeformat} in Word2000, but I can't get it to
calculate in Word 2003. I know how to get the field codes - I just can't get
the multiplication to work. Also, I have another calculation to do - that is
a subtraction. It subtracts another mergefield from the results of the
formula listed above.
Any help would be appreciated.

Re: Perform mathematical calculations with merge fields
"Doug Robbins - Word MVP" <dkr[ at ]REMOVECAPSmvps.org> 5/23/2007 7:56:31 PM
You will need to do something to cause the fields to update. Either use
Ctrl+A to select everything and then use F9, or in the Tools>Options>Print
tab dialog, check the box to update fields when printing.

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

"cjlatta" <cjlatta[ at ]discussions.microsoft.com> wrote in message
news:1A9FAA72-7BB8-4396-9A40-82B9B89A7BC7[ at ]microsoft.com...
[Quoted Text]
>I have a letter that we created in Word 2000 that I need to update. I
>can't
> open the document in Word 2003, so I'm recreating it. The document
> contains
> several merge fields. I want to perform a multiplication of a merge field
> (which is a number) by a set number (in the example it's 35). I used the
> {=35*{mergefield xxx}\#,0.00\*Mergeformat} in Word2000, but I can't get it
> to
> calculate in Word 2003. I know how to get the field codes - I just can't
> get
> the multiplication to work. Also, I have another calculation to do - that
> is
> a subtraction. It subtracts another mergefield from the results of the
> formula listed above.
> Any help would be appreciated.
>


Re: Perform mathematical calculations with merge fields
cjlatta 5/23/2007 8:10:01 PM
I'm not sure this will work, but I'll give it a shot. Since I'm doing the
recreation route, I think where my trouble lies is in the actual calculation
portion of the formula - I can't get the additional bracket into the formula
and thus get the multiplication to work.
Thanks though - I'll give it a try.

"Doug Robbins - Word MVP" wrote:

[Quoted Text]
> You will need to do something to cause the fields to update. Either use
> Ctrl+A to select everything and then use F9, or in the Tools>Options>Print
> tab dialog, check the box to update fields when printing.
>
> --
> 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
>
> "cjlatta" <cjlatta[ at ]discussions.microsoft.com> wrote in message
> news:1A9FAA72-7BB8-4396-9A40-82B9B89A7BC7[ at ]microsoft.com...
> >I have a letter that we created in Word 2000 that I need to update. I
> >can't
> > open the document in Word 2003, so I'm recreating it. The document
> > contains
> > several merge fields. I want to perform a multiplication of a merge field
> > (which is a number) by a set number (in the example it's 35). I used the
> > {=35*{mergefield xxx}\#,0.00\*Mergeformat} in Word2000, but I can't get it
> > to
> > calculate in Word 2003. I know how to get the field codes - I just can't
> > get
> > the multiplication to work. Also, I have another calculation to do - that
> > is
> > a subtraction. It subtracts another mergefield from the results of the
> > formula listed above.
> > Any help would be appreciated.
> >
>
>
>
Re: Perform mathematical calculations with merge fields
cjlatta 5/23/2007 8:44:00 PM
Duh! - found my answer - if you don't make it a formula (insert/formula), it
won't work!
Thanks, Doug, for your suggestions - I'll keep them for future use.

"cjlatta" wrote:

[Quoted Text]
> I'm not sure this will work, but I'll give it a shot. Since I'm doing the
> recreation route, I think where my trouble lies is in the actual calculation
> portion of the formula - I can't get the additional bracket into the formula
> and thus get the multiplication to work.
> Thanks though - I'll give it a try.
>
> "Doug Robbins - Word MVP" wrote:
>
> > You will need to do something to cause the fields to update. Either use
> > Ctrl+A to select everything and then use F9, or in the Tools>Options>Print
> > tab dialog, check the box to update fields when printing.
> >
> > --
> > 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
> >
> > "cjlatta" <cjlatta[ at ]discussions.microsoft.com> wrote in message
> > news:1A9FAA72-7BB8-4396-9A40-82B9B89A7BC7[ at ]microsoft.com...
> > >I have a letter that we created in Word 2000 that I need to update. I
> > >can't
> > > open the document in Word 2003, so I'm recreating it. The document
> > > contains
> > > several merge fields. I want to perform a multiplication of a merge field
> > > (which is a number) by a set number (in the example it's 35). I used the
> > > {=35*{mergefield xxx}\#,0.00\*Mergeformat} in Word2000, but I can't get it
> > > to
> > > calculate in Word 2003. I know how to get the field codes - I just can't
> > > get
> > > the multiplication to work. Also, I have another calculation to do - that
> > > is
> > > a subtraction. It subtracts another mergefield from the results of the
> > > formula listed above.
> > > Any help would be appreciated.
> > >
> >
> >
> >
Re: Perform mathematical calculations with merge fields
"Doug Robbins - Word MVP" <dkr[ at ]REMOVECAPSmvps.org> 5/24/2007 8:27:03 AM
Sure, you need to use Ctrl+F9 to insert each pair of field delimiters { }.
Entering them by the use of the keys with those symbols on them on the
keyboard will not result in the creation of an field.

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

"cjlatta" <cjlatta[ at ]discussions.microsoft.com> wrote in message
news:CAF15813-1C80-43B7-BC2E-9D72AD8833CC[ at ]microsoft.com...
[Quoted Text]
> Duh! - found my answer - if you don't make it a formula (insert/formula),
> it
> won't work!
> Thanks, Doug, for your suggestions - I'll keep them for future use.
>
> "cjlatta" wrote:
>
>> I'm not sure this will work, but I'll give it a shot. Since I'm doing
>> the
>> recreation route, I think where my trouble lies is in the actual
>> calculation
>> portion of the formula - I can't get the additional bracket into the
>> formula
>> and thus get the multiplication to work.
>> Thanks though - I'll give it a try.
>>
>> "Doug Robbins - Word MVP" wrote:
>>
>> > You will need to do something to cause the fields to update. Either
>> > use
>> > Ctrl+A to select everything and then use F9, or in the
>> > Tools>Options>Print
>> > tab dialog, check the box to update fields when printing.
>> >
>> > --
>> > 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
>> >
>> > "cjlatta" <cjlatta[ at ]discussions.microsoft.com> wrote in message
>> > news:1A9FAA72-7BB8-4396-9A40-82B9B89A7BC7[ at ]microsoft.com...
>> > >I have a letter that we created in Word 2000 that I need to update. I
>> > >can't
>> > > open the document in Word 2003, so I'm recreating it. The document
>> > > contains
>> > > several merge fields. I want to perform a multiplication of a merge
>> > > field
>> > > (which is a number) by a set number (in the example it's 35). I used
>> > > the
>> > > {=35*{mergefield xxx}\#,0.00\*Mergeformat} in Word2000, but I can't
>> > > get it
>> > > to
>> > > calculate in Word 2003. I know how to get the field codes - I just
>> > > can't
>> > > get
>> > > the multiplication to work. Also, I have another calculation to do -
>> > > that
>> > > is
>> > > a subtraction. It subtracts another mergefield from the results of
>> > > the
>> > > formula listed above.
>> > > Any help would be appreciated.
>> > >
>> >
>> >
>> >


Re: Perform mathematical calculations with merge fields
thatangrykid 5/24/2007 7:14:01 PM
Hi,
I've been smashing my head against the cube wall for the past few days
trying to get a calculation out of the mail merge fields I have set up in a
table. I have harnessed the power of =SUM(ABOVE) to get my Grand Total, and
I also discovered the Bookmark function so that the users can enter in the
number of years the deal is for and have used that number for calculations.
But in order to express the Total for each product, I can't seem to figure
out a way to take the Bookmarked quantity number and multiply it by the Unit
Price without getting an error message during the merge.


Re: Perform mathematical calculations with merge fields
"Doug Robbins - Word MVP" <dkr[ at ]REMOVECAPSmvps.org> 5/24/2007 9:31:22 PM
Is this a continuation of the original thread under which it appears or a
new and different situation.

You need to give full information of what you are starting with and what you
want to achieve if you want to get assistance that will lead to a solution
of your problem. Sometimes, just describing the way that you have going
about trying to achieve something is not sufficient, particularly when, with
the full knowledge of what it is, that turns out to either an inappropriate,
or at least not the best method of going about it.

--
Regards.

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

Doug Robbins - Word MVP

"thatangrykid" <thatangrykid[ at ]discussions.microsoft.com> wrote in message
news:485FB6C8-4AF6-4A22-91B4-FAB379B93560[ at ]microsoft.com...
[Quoted Text]
> Hi,
> I've been smashing my head against the cube wall for the past few days
> trying to get a calculation out of the mail merge fields I have set up in
> a
> table. I have harnessed the power of =SUM(ABOVE) to get my Grand Total,
> and
> I also discovered the Bookmark function so that the users can enter in the
> number of years the deal is for and have used that number for
> calculations.
> But in order to express the Total for each product, I can't seem to figure
> out a way to take the Bookmarked quantity number and multiply it by the
> Unit
> Price without getting an error message during the merge.
>
>


Re: Perform mathematical calculations with merge fields
thatangrykid 5/25/2007 1:52:00 PM
I posted the question in this thread because it is exactly what I'm having a
problem with - performing calculations using merge fields. I have become
accustomed to getting yelled at by moderators for starting another thread
with the same subject, so I opted to post under this. Sorry if this too is
wrong.

As for the problem, I don't know how granular you want me to get, so I'll
start from the very beginning and apologize if it's long.

The document I'm trying to build is an invoice that sales would be able to
generate invoices with from our sales system. Searching the internet, I came
upon a template that seemed like what I was looking for. One row across
citing Product Name, Product Unit Price and the last giving the Total Price
for the product. A Grand Total column totals all the lines above it using
=SUM(TOTAL). As our product is a software service sold on a yearly basis, it
would be ideal to have some way for the one template to accommodate every
multi-year scenario we have. I used the ASK code to prompt the user to enter
in the number of years that the deal was for. This value is stored in a
bookmark called YEARS, and this in turn is used in a field that calculates
the cost per year.

So far as I can tell, I need the proper syntax to multiply a mergefield by a
bookmark and have it format as a dollar amount. I need to multiply the
Product Unit Price mergefield by the value entered into the YEARS bookmark by
the user to get the Total Price for each product on each line of the invoice.
Adding a quantity field with a fixed number is not possible because of the
way finance set up the sales system. I found a page in the Microsoft Help
and Support site titled "WD: Performing Calculations in a Mail Merge Field"
which had some examples of calculations, but every time I try entering the
formulas into the word document, it gives me the "!SyntaxError" message.

I hope this explains my problem better and thank you for any help you can
give me.

"Doug Robbins - Word MVP" wrote:

[Quoted Text]
> Is this a continuation of the original thread under which it appears or a
> new and different situation.
>
> You need to give full information of what you are starting with and what you
> want to achieve if you want to get assistance that will lead to a solution
> of your problem. Sometimes, just describing the way that you have going
> about trying to achieve something is not sufficient, particularly when, with
> the full knowledge of what it is, that turns out to either an inappropriate,
> or at least not the best method of going about it.
>
> --
> Regards.
>
> Please reply to the newsgroup unless you wish to avail yourself of my
> services on a paid consulting basis.
>
> Doug Robbins - Word MVP
>
> "thatangrykid" <thatangrykid[ at ]discussions.microsoft.com> wrote in message
> news:485FB6C8-4AF6-4A22-91B4-FAB379B93560[ at ]microsoft.com...
> > Hi,
> > I've been smashing my head against the cube wall for the past few days
> > trying to get a calculation out of the mail merge fields I have set up in
> > a
> > table. I have harnessed the power of =SUM(ABOVE) to get my Grand Total,
> > and
> > I also discovered the Bookmark function so that the users can enter in the
> > number of years the deal is for and have used that number for
> > calculations.
> > But in order to express the Total for each product, I can't seem to figure
> > out a way to take the Bookmarked quantity number and multiply it by the
> > Unit
> > Price without getting an error message during the merge.

Re: Perform mathematical calculations with merge fields
"Doug Robbins - Word MVP" <dkr[ at ]REMOVECAPSmvps.org> 5/25/2007 3:15:34 PM
There are no moderators in these newsgroups and when people post under names
such as thatangrykid into a thread posted by cjlatta where, at least I
thought my last response should have fixed the issue, it was not an
unreasonable question to ask, otherwise I would have been quite likely to
have just said "See my previous response"

In your case, while I would not use mailmerge to create documents such as
this, if you want to get the product of a mailmerge field and the content of
a bookmark, you need to use a { REF bookmarkname } field to get the contents
of the bookmark

The calculation would then be

{ = { MERGEFIELD fieldname } * { REF bookmarkname } }

If you are getting syntax errors, the best way to get help would be to
include in your post the field construction that you have that is giving the
error.

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

"thatangrykid" <thatangrykid[ at ]discussions.microsoft.com> wrote in message
news:A2F52E0B-9CB9-40E4-8D3B-E4740723B57F[ at ]microsoft.com...
[Quoted Text]
>I posted the question in this thread because it is exactly what I'm having
>a
> problem with - performing calculations using merge fields. I have become
> accustomed to getting yelled at by moderators for starting another thread
> with the same subject, so I opted to post under this. Sorry if this too
> is
> wrong.
>
> As for the problem, I don't know how granular you want me to get, so I'll
> start from the very beginning and apologize if it's long.
>
> The document I'm trying to build is an invoice that sales would be able to
> generate invoices with from our sales system. Searching the internet, I
> came
> upon a template that seemed like what I was looking for. One row across
> citing Product Name, Product Unit Price and the last giving the Total
> Price
> for the product. A Grand Total column totals all the lines above it using
> =SUM(TOTAL). As our product is a software service sold on a yearly basis,
> it
> would be ideal to have some way for the one template to accommodate every
> multi-year scenario we have. I used the ASK code to prompt the user to
> enter
> in the number of years that the deal was for. This value is stored in a
> bookmark called YEARS, and this in turn is used in a field that calculates
> the cost per year.
>
> So far as I can tell, I need the proper syntax to multiply a mergefield by
> a
> bookmark and have it format as a dollar amount. I need to multiply the
> Product Unit Price mergefield by the value entered into the YEARS bookmark
> by
> the user to get the Total Price for each product on each line of the
> invoice.
> Adding a quantity field with a fixed number is not possible because of the
> way finance set up the sales system. I found a page in the Microsoft Help
> and Support site titled "WD: Performing Calculations in a Mail Merge
> Field"
> which had some examples of calculations, but every time I try entering the
> formulas into the word document, it gives me the "!SyntaxError" message.
>
> I hope this explains my problem better and thank you for any help you can
> give me.
>
> "Doug Robbins - Word MVP" wrote:
>
>> Is this a continuation of the original thread under which it appears or a
>> new and different situation.
>>
>> You need to give full information of what you are starting with and what
>> you
>> want to achieve if you want to get assistance that will lead to a
>> solution
>> of your problem. Sometimes, just describing the way that you have going
>> about trying to achieve something is not sufficient, particularly when,
>> with
>> the full knowledge of what it is, that turns out to either an
>> inappropriate,
>> or at least not the best method of going about it.
>>
>> --
>> Regards.
>>
>> Please reply to the newsgroup unless you wish to avail yourself of my
>> services on a paid consulting basis.
>>
>> Doug Robbins - Word MVP
>>
>> "thatangrykid" <thatangrykid[ at ]discussions.microsoft.com> wrote in message
>> news:485FB6C8-4AF6-4A22-91B4-FAB379B93560[ at ]microsoft.com...
>> > Hi,
>> > I've been smashing my head against the cube wall for the past few days
>> > trying to get a calculation out of the mail merge fields I have set up
>> > in
>> > a
>> > table. I have harnessed the power of =SUM(ABOVE) to get my Grand
>> > Total,
>> > and
>> > I also discovered the Bookmark function so that the users can enter in
>> > the
>> > number of years the deal is for and have used that number for
>> > calculations.
>> > But in order to express the Total for each product, I can't seem to
>> > figure
>> > out a way to take the Bookmarked quantity number and multiply it by the
>> > Unit
>> > Price without getting an error message during the merge.
>


Re: Perform mathematical calculations with merge fields
thatangrykid 5/25/2007 4:06:02 PM
Thanks for the help. I'll repay the favor by never coming here again.


"Doug Robbins - Word MVP" wrote:

[Quoted Text]
> There are no moderators in these newsgroups and when people post under names
> such as thatangrykid into a thread posted by cjlatta where, at least I
> thought my last response should have fixed the issue, it was not an
> unreasonable question to ask, otherwise I would have been quite likely to
> have just said "See my previous response"
>
> In your case, while I would not use mailmerge to create documents such as
> this, if you want to get the product of a mailmerge field and the content of
> a bookmark, you need to use a { REF bookmarkname } field to get the contents
> of the bookmark
>
> The calculation would then be
>
> { = { MERGEFIELD fieldname } * { REF bookmarkname } }
>
> If you are getting syntax errors, the best way to get help would be to
> include in your post the field construction that you have that is giving the
> error.
>
> --
> 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
>
> "thatangrykid" <thatangrykid[ at ]discussions.microsoft.com> wrote in message
> news:A2F52E0B-9CB9-40E4-8D3B-E4740723B57F[ at ]microsoft.com...
> >I posted the question in this thread because it is exactly what I'm having
> >a
> > problem with - performing calculations using merge fields. I have become
> > accustomed to getting yelled at by moderators for starting another thread
> > with the same subject, so I opted to post under this. Sorry if this too
> > is
> > wrong.
> >
> > As for the problem, I don't know how granular you want me to get, so I'll
> > start from the very beginning and apologize if it's long.
> >
> > The document I'm trying to build is an invoice that sales would be able to
> > generate invoices with from our sales system. Searching the internet, I
> > came
> > upon a template that seemed like what I was looking for. One row across
> > citing Product Name, Product Unit Price and the last giving the Total
> > Price
> > for the product. A Grand Total column totals all the lines above it using
> > =SUM(TOTAL). As our product is a software service sold on a yearly basis,
> > it
> > would be ideal to have some way for the one template to accommodate every
> > multi-year scenario we have. I used the ASK code to prompt the user to
> > enter
> > in the number of years that the deal was for. This value is stored in a
> > bookmark called YEARS, and this in turn is used in a field that calculates
> > the cost per year.
> >
> > So far as I can tell, I need the proper syntax to multiply a mergefield by
> > a
> > bookmark and have it format as a dollar amount. I need to multiply the
> > Product Unit Price mergefield by the value entered into the YEARS bookmark
> > by
> > the user to get the Total Price for each product on each line of the
> > invoice.
> > Adding a quantity field with a fixed number is not possible because of the
> > way finance set up the sales system. I found a page in the Microsoft Help
> > and Support site titled "WD: Performing Calculations in a Mail Merge
> > Field"
> > which had some examples of calculations, but every time I try entering the
> > formulas into the word document, it gives me the "!SyntaxError" message.
> >
> > I hope this explains my problem better and thank you for any help you can
> > give me.
> >
> > "Doug Robbins - Word MVP" wrote:
> >
> >> Is this a continuation of the original thread under which it appears or a
> >> new and different situation.
> >>
> >> You need to give full information of what you are starting with and what
> >> you
> >> want to achieve if you want to get assistance that will lead to a
> >> solution
> >> of your problem. Sometimes, just describing the way that you have going
> >> about trying to achieve something is not sufficient, particularly when,
> >> with
> >> the full knowledge of what it is, that turns out to either an
> >> inappropriate,
> >> or at least not the best method of going about it.
> >>
> >> --
> >> Regards.
> >>
> >> Please reply to the newsgroup unless you wish to avail yourself of my
> >> services on a paid consulting basis.
> >>
> >> Doug Robbins - Word MVP
> >>
> >> "thatangrykid" <thatangrykid[ at ]discussions.microsoft.com> wrote in message
> >> news:485FB6C8-4AF6-4A22-91B4-FAB379B93560[ at ]microsoft.com...
> >> > Hi,
> >> > I've been smashing my head against the cube wall for the past few days
> >> > trying to get a calculation out of the mail merge fields I have set up
> >> > in
> >> > a
> >> > table. I have harnessed the power of =SUM(ABOVE) to get my Grand
> >> > Total,
> >> > and
> >> > I also discovered the Bookmark function so that the users can enter in
> >> > the
> >> > number of years the deal is for and have used that number for
> >> > calculations.
> >> > But in order to express the Total for each product, I can't seem to
> >> > figure
> >> > out a way to take the Bookmarked quantity number and multiply it by the
> >> > Unit
> >> > Price without getting an error message during the merge.
> >
>
>
>
Re: Perform mathematical calculations with merge fields
"Peter Jamieson" <pjj[ at ]KillmapSpjjnet.demon.co.uk> 5/25/2007 4:50:07 PM
[Quoted Text]
> by never coming here again.

Well, that's a relief.

Peter Jamieson
"thatangrykid" <thatangrykid[ at ]discussions.microsoft.com> wrote in message
news:C24BDB82-D284-42E0-8BF8-FB7DD8836ACD[ at ]microsoft.com...
> Thanks for the help. I'll repay the favor by never coming here again.
>
>
> "Doug Robbins - Word MVP" wrote:
>
>> There are no moderators in these newsgroups and when people post under
>> names
>> such as thatangrykid into a thread posted by cjlatta where, at least I
>> thought my last response should have fixed the issue, it was not an
>> unreasonable question to ask, otherwise I would have been quite likely to
>> have just said "See my previous response"
>>
>> In your case, while I would not use mailmerge to create documents such as
>> this, if you want to get the product of a mailmerge field and the content
>> of
>> a bookmark, you need to use a { REF bookmarkname } field to get the
>> contents
>> of the bookmark
>>
>> The calculation would then be
>>
>> { = { MERGEFIELD fieldname } * { REF bookmarkname } }
>>
>> If you are getting syntax errors, the best way to get help would be to
>> include in your post the field construction that you have that is giving
>> the
>> error.
>>
>> --
>> 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
>>
>> "thatangrykid" <thatangrykid[ at ]discussions.microsoft.com> wrote in message
>> news:A2F52E0B-9CB9-40E4-8D3B-E4740723B57F[ at ]microsoft.com...
>> >I posted the question in this thread because it is exactly what I'm
>> >having
>> >a
>> > problem with - performing calculations using merge fields. I have
>> > become
>> > accustomed to getting yelled at by moderators for starting another
>> > thread
>> > with the same subject, so I opted to post under this. Sorry if this
>> > too
>> > is
>> > wrong.
>> >
>> > As for the problem, I don't know how granular you want me to get, so
>> > I'll
>> > start from the very beginning and apologize if it's long.
>> >
>> > The document I'm trying to build is an invoice that sales would be able
>> > to
>> > generate invoices with from our sales system. Searching the internet,
>> > I
>> > came
>> > upon a template that seemed like what I was looking for. One row
>> > across
>> > citing Product Name, Product Unit Price and the last giving the Total
>> > Price
>> > for the product. A Grand Total column totals all the lines above it
>> > using
>> > =SUM(TOTAL). As our product is a software service sold on a yearly
>> > basis,
>> > it
>> > would be ideal to have some way for the one template to accommodate
>> > every
>> > multi-year scenario we have. I used the ASK code to prompt the user to
>> > enter
>> > in the number of years that the deal was for. This value is stored in
>> > a
>> > bookmark called YEARS, and this in turn is used in a field that
>> > calculates
>> > the cost per year.
>> >
>> > So far as I can tell, I need the proper syntax to multiply a mergefield
>> > by
>> > a
>> > bookmark and have it format as a dollar amount. I need to multiply the
>> > Product Unit Price mergefield by the value entered into the YEARS
>> > bookmark
>> > by
>> > the user to get the Total Price for each product on each line of the
>> > invoice.
>> > Adding a quantity field with a fixed number is not possible because of
>> > the
>> > way finance set up the sales system. I found a page in the Microsoft
>> > Help
>> > and Support site titled "WD: Performing Calculations in a Mail Merge
>> > Field"
>> > which had some examples of calculations, but every time I try entering
>> > the
>> > formulas into the word document, it gives me the "!SyntaxError"
>> > message.
>> >
>> > I hope this explains my problem better and thank you for any help you
>> > can
>> > give me.
>> >
>> > "Doug Robbins - Word MVP" wrote:
>> >
>> >> Is this a continuation of the original thread under which it appears
>> >> or a
>> >> new and different situation.
>> >>
>> >> You need to give full information of what you are starting with and
>> >> what
>> >> you
>> >> want to achieve if you want to get assistance that will lead to a
>> >> solution
>> >> of your problem. Sometimes, just describing the way that you have
>> >> going
>> >> about trying to achieve something is not sufficient, particularly
>> >> when,
>> >> with
>> >> the full knowledge of what it is, that turns out to either an
>> >> inappropriate,
>> >> or at least not the best method of going about it.
>> >>
>> >> --
>> >> Regards.
>> >>
>> >> Please reply to the newsgroup unless you wish to avail yourself of my
>> >> services on a paid consulting basis.
>> >>
>> >> Doug Robbins - Word MVP
>> >>
>> >> "thatangrykid" <thatangrykid[ at ]discussions.microsoft.com> wrote in
>> >> message
>> >> news:485FB6C8-4AF6-4A22-91B4-FAB379B93560[ at ]microsoft.com...
>> >> > Hi,
>> >> > I've been smashing my head against the cube wall for the past few
>> >> > days
>> >> > trying to get a calculation out of the mail merge fields I have set
>> >> > up
>> >> > in
>> >> > a
>> >> > table. I have harnessed the power of =SUM(ABOVE) to get my Grand
>> >> > Total,
>> >> > and
>> >> > I also discovered the Bookmark function so that the users can enter
>> >> > in
>> >> > the
>> >> > number of years the deal is for and have used that number for
>> >> > calculations.
>> >> > But in order to express the Total for each product, I can't seem to
>> >> > figure
>> >> > out a way to take the Bookmarked quantity number and multiply it by
>> >> > the
>> >> > Unit
>> >> > Price without getting an error message during the merge.
>> >
>>
>>
>>

Re: Perform mathematical calculations with merge fields
"Doug Robbins - Word MVP" <dkr[ at ]REMOVECAPSmvps.org> 5/25/2007 5:08:43 PM
Sorry, I did not realise that you were posting under your real name.

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

"thatangrykid" <thatangrykid[ at ]discussions.microsoft.com> wrote in message
news:C24BDB82-D284-42E0-8BF8-FB7DD8836ACD[ at ]microsoft.com...
[Quoted Text]
> Thanks for the help. I'll repay the favor by never coming here again.
>
>
> "Doug Robbins - Word MVP" wrote:
>
>> There are no moderators in these newsgroups and when people post under
>> names
>> such as thatangrykid into a thread posted by cjlatta where, at least I
>> thought my last response should have fixed the issue, it was not an
>> unreasonable question to ask, otherwise I would have been quite likely to
>> have just said "See my previous response"
>>
>> In your case, while I would not use mailmerge to create documents such as
>> this, if you want to get the product of a mailmerge field and the content
>> of
>> a bookmark, you need to use a { REF bookmarkname } field to get the
>> contents
>> of the bookmark
>>
>> The calculation would then be
>>
>> { = { MERGEFIELD fieldname } * { REF bookmarkname } }
>>
>> If you are getting syntax errors, the best way to get help would be to
>> include in your post the field construction that you have that is giving
>> the
>> error.
>>
>> --
>> 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
>>
>> "thatangrykid" <thatangrykid[ at ]discussions.microsoft.com> wrote in message
>> news:A2F52E0B-9CB9-40E4-8D3B-E4740723B57F[ at ]microsoft.com...
>> >I posted the question in this thread because it is exactly what I'm
>> >having
>> >a
>> > problem with - performing calculations using merge fields. I have
>> > become
>> > accustomed to getting yelled at by moderators for starting another
>> > thread
>> > with the same subject, so I opted to post under this. Sorry if this
>> > too
>> > is
>> > wrong.
>> >
>> > As for the problem, I don't know how granular you want me to get, so
>> > I'll
>> > start from the very beginning and apologize if it's long.
>> >
>> > The document I'm trying to build is an invoice that sales would be able
>> > to
>> > generate invoices with from our sales system. Searching the internet,
>> > I
>> > came
>> > upon a template that seemed like what I was looking for. One row
>> > across
>> > citing Product Name, Product Unit Price and the last giving the Total
>> > Price
>> > for the product. A Grand Total column totals all the lines above it
>> > using
>> > =SUM(TOTAL). As our product is a software service sold on a yearly
>> > basis,
>> > it
>> > would be ideal to have some way for the one template to accommodate
>> > every
>> > multi-year scenario we have. I used the ASK code to prompt the user to
>> > enter
>> > in the number of years that the deal was for. This value is stored in
>> > a
>> > bookmark called YEARS, and this in turn is used in a field that
>> > calculates
>> > the cost per year.
>> >
>> > So far as I can tell, I need the proper syntax to multiply a mergefield
>> > by
>> > a
>> > bookmark and have it format as a dollar amount. I need to multiply the
>> > Product Unit Price mergefield by the value entered into the YEARS
>> > bookmark
>> > by
>> > the user to get the Total Price for each product on each line of the
>> > invoice.
>> > Adding a quantity field with a fixed number is not possible because of
>> > the
>> > way finance set up the sales system. I found a page in the Microsoft
>> > Help
>> > and Support site titled "WD: Performing Calculations in a Mail Merge
>> > Field"
>> > which had some examples of calculations, but every time I try entering
>> > the
>> > formulas into the word document, it gives me the "!SyntaxError"
>> > message.
>> >
>> > I hope this explains my problem better and thank you for any help you
>> > can
>> > give me.
>> >
>> > "Doug Robbins - Word MVP" wrote:
>> >
>> >> Is this a continuation of the original thread under which it appears
>> >> or a
>> >> new and different situation.
>> >>
>> >> You need to give full information of what you are starting with and
>> >> what
>> >> you
>> >> want to achieve if you want to get assistance that will lead to a
>> >> solution
>> >> of your problem. Sometimes, just describing the way that you have
>> >> going
>> >> about trying to achieve something is not sufficient, particularly
>> >> when,
>> >> with
>> >> the full knowledge of what it is, that turns out to either an
>> >> inappropriate,
>> >> or at least not the best method of going about it.
>> >>
>> >> --
>> >> Regards.
>> >>
>> >> Please reply to the newsgroup unless you wish to avail yourself of my
>> >> services on a paid consulting basis.
>> >>
>> >> Doug Robbins - Word MVP
>> >>
>> >> "thatangrykid" <thatangrykid[ at ]discussions.microsoft.com> wrote in
>> >> message
>> >> news:485FB6C8-4AF6-4A22-91B4-FAB379B93560[ at ]microsoft.com...
>> >> > Hi,
>> >> > I've been smashing my head against the cube wall for the past few
>> >> > days
>> >> > trying to get a calculation out of the mail merge fields I have set
>> >> > up
>> >> > in
>> >> > a
>> >> > table. I have harnessed the power of =SUM(ABOVE) to get my Grand
>> >> > Total,
>> >> > and
>> >> > I also discovered the Bookmark function so that the users can enter
>> >> > in
>> >> > the
>> >> > number of years the deal is for and have used that number for
>> >> > calculations.
>> >> > But in order to express the Total for each product, I can't seem to
>> >> > figure
>> >> > out a way to take the Bookmarked quantity number and multiply it by
>> >> > the
>> >> > Unit
>> >> > Price without getting an error message during the merge.
>> >
>>
>>
>>


Re: Perform mathematical calculations with merge fields
Noel 10/28/2008 5:06:12 PM
I am merging from an Access Database, I need to subtract two fields and so
would I post it as
{={MERGEFIELD Quarterly_Cost} - {MERGEFIELD QuarterlySubsidy}}


"Doug Robbins - Word MVP" wrote:

[Quoted Text]
> Sorry, I did not realise that you were posting under your real name.
>
> --
> 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
>
> "thatangrykid" <thatangrykid[ at ]discussions.microsoft.com> wrote in message
> news:C24BDB82-D284-42E0-8BF8-FB7DD8836ACD[ at ]microsoft.com...
> > Thanks for the help. I'll repay the favor by never coming here again.
> >
> >
> > "Doug Robbins - Word MVP" wrote:
> >
> >> There are no moderators in these newsgroups and when people post under
> >> names
> >> such as thatangrykid into a thread posted by cjlatta where, at least I
> >> thought my last response should have fixed the issue, it was not an
> >> unreasonable question to ask, otherwise I would have been quite likely to
> >> have just said "See my previous response"
> >>
> >> In your case, while I would not use mailmerge to create documents such as
> >> this, if you want to get the product of a mailmerge field and the content
> >> of
> >> a bookmark, you need to use a { REF bookmarkname } field to get the
> >> contents
> >> of the bookmark
> >>
> >> The calculation would then be
> >>
> >> { = { MERGEFIELD fieldname } * { REF bookmarkname } }
> >>
> >> If you are getting syntax errors, the best way to get help would be to
> >> include in your post the field construction that you have that is giving
> >> the
> >> error.
> >>
> >> --
> >> 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
> >>
> >> "thatangrykid" <thatangrykid[ at ]discussions.microsoft.com> wrote in message
> >> news:A2F52E0B-9CB9-40E4-8D3B-E4740723B57F[ at ]microsoft.com...
> >> >I posted the question in this thread because it is exactly what I'm
> >> >having
> >> >a
> >> > problem with - performing calculations using merge fields. I have
> >> > become
> >> > accustomed to getting yelled at by moderators for starting another
> >> > thread
> >> > with the same subject, so I opted to post under this. Sorry if this
> >> > too
> >> > is
> >> > wrong.
> >> >
> >> > As for the problem, I don't know how granular you want me to get, so
> >> > I'll
> >> > start from the very beginning and apologize if it's long.
> >> >
> >> > The document I'm trying to build is an invoice that sales would be able
> >> > to
> >> > generate invoices with from our sales system. Searching the internet,
> >> > I
> >> > came
> >> > upon a template that seemed like what I was looking for. One row
> >> > across
> >> > citing Product Name, Product Unit Price and the last giving the Total
> >> > Price
> >> > for the product. A Grand Total column totals all the lines above it
> >> > using
> >> > =SUM(TOTAL). As our product is a software service sold on a yearly
> >> > basis,
> >> > it
> >> > would be ideal to have some way for the one template to accommodate
> >> > every
> >> > multi-year scenario we have. I used the ASK code to prompt the user to
> >> > enter
> >> > in the number of years that the deal was for. This value is stored in
> >> > a
> >> > bookmark called YEARS, and this in turn is used in a field that
> >> > calculates
> >> > the cost per year.
> >> >
> >> > So far as I can tell, I need the proper syntax to multiply a mergefield
> >> > by
> >> > a
> >> > bookmark and have it format as a dollar amount. I need to multiply the
> >> > Product Unit Price mergefield by the value entered into the YEARS
> >> > bookmark
> >> > by
> >> > the user to get the Total Price for each product on each line of the
> >> > invoice.
> >> > Adding a quantity field with a fixed number is not possible because of
> >> > the
> >> > way finance set up the sales system. I found a page in the Microsoft
> >> > Help
> >> > and Support site titled "WD: Performing Calculations in a Mail Merge
> >> > Field"
> >> > which had some examples of calculations, but every time I try entering
> >> > the
> >> > formulas into the word document, it gives me the "!SyntaxError"
> >> > message.
> >> >
> >> > I hope this explains my problem better and thank you for any help you
> >> > can
> >> > give me.
> >> >
> >> > "Doug Robbins - Word MVP" wrote:
> >> >
> >> >> Is this a continuation of the original thread under which it appears
> >> >> or a
> >> >> new and different situation.
> >> >>
> >> >> You need to give full information of what you are starting with and
> >> >> what
> >> >> you
> >> >> want to achieve if you want to get assistance that will lead to a
> >> >> solution
> >> >> of your problem. Sometimes, just describing the way that you have
> >> >> going
> >> >> about trying to achieve something is not sufficient, particularly
> >> >> when,
> >> >> with
> >> >> the full knowledge of what it is, that turns out to either an
> >> >> inappropriate,
> >> >> or at least not the best method of going about it.
> >> >>
> >> >> --
> >> >> Regards.
> >> >>
> >> >> Please reply to the newsgroup unless you wish to avail yourself of my
> >> >> services on a paid consulting basis.
> >> >>
> >> >> Doug Robbins - Word MVP
> >> >>
> >> >> "thatangrykid" <thatangrykid[ at ]discussions.microsoft.com> wrote in
> >> >> message
> >> >> news:485FB6C8-4AF6-4A22-91B4-FAB379B93560[ at ]microsoft.com...
> >> >> > Hi,
> >> >> > I've been smashing my head against the cube wall for the past few
> >> >> > days
> >> >> > trying to get a calculation out of the mail merge fields I have set
> >> >> > up
> >> >> > in
> >> >> > a
> >> >> > table. I have harnessed the power of =SUM(ABOVE) to get my Grand
> >> >> > Total,
> >> >> > and
> >> >> > I also discovered the Bookmark function so that the users can enter
> >> >> > in
> >> >> > the
> >> >> > number of years the deal is for and have used that number for
> >> >> > calculations.
> >> >> > But in order to express the Total for each product, I can't seem to
> >> >> > figure
> >> >> > out a way to take the Bookmarked quantity number and multiply it by
> >> >> > the
> >> >> > Unit
> >> >> > Price without getting an error message during the merge.
> >> >
> >>
> >>
> >>
>
>
>
Re: Perform mathematical calculations with merge fields
"Peter Jamieson" <pjj[ at ]KillmapSpjjnet.demon.co.uk> 10/28/2008 5:25:01 PM
Yes, as long as all three pairs of {} are the special field code braces that
you can insert using ctrl-F9. Everything else is plain text.

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

"Noel" <Noel[ at ]discussions.microsoft.com> wrote in message
news:A0B8A383-6AA1-4472-A0F9-8850921F1419[ at ]microsoft.com...
[Quoted Text]
>I am merging from an Access Database, I need to subtract two fields and so
> would I post it as
> {={MERGEFIELD Quarterly_Cost} - {MERGEFIELD QuarterlySubsidy}}
>
>
> "Doug Robbins - Word MVP" wrote:
>
>> Sorry, I did not realise that you were posting under your real name.
>>
>> --
>> 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
>>
>> "thatangrykid" <thatangrykid[ at ]discussions.microsoft.com> wrote in message
>> news:C24BDB82-D284-42E0-8BF8-FB7DD8836ACD[ at ]microsoft.com...
>> > Thanks for the help. I'll repay the favor by never coming here again.
>> >
>> >
>> > "Doug Robbins - Word MVP" wrote:
>> >
>> >> There are no moderators in these newsgroups and when people post under
>> >> names
>> >> such as thatangrykid into a thread posted by cjlatta where, at least I
>> >> thought my last response should have fixed the issue, it was not an
>> >> unreasonable question to ask, otherwise I would have been quite likely
>> >> to
>> >> have just said "See my previous response"
>> >>
>> >> In your case, while I would not use mailmerge to create documents such
>> >> as
>> >> this, if you want to get the product of a mailmerge field and the
>> >> content
>> >> of
>> >> a bookmark, you need to use a { REF bookmarkname } field to get the
>> >> contents
>> >> of the bookmark
>> >>
>> >> The calculation would then be
>> >>
>> >> { = { MERGEFIELD fieldname } * { REF bookmarkname } }
>> >>
>> >> If you are getting syntax errors, the best way to get help would be to
>> >> include in your post the field construction that you have that is
>> >> giving
>> >> the
>> >> error.
>> >>
>> >> --
>> >> 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
>> >>
>> >> "thatangrykid" <thatangrykid[ at ]discussions.microsoft.com> wrote in
>> >> message
>> >> news:A2F52E0B-9CB9-40E4-8D3B-E4740723B57F[ at ]microsoft.com...
>> >> >I posted the question in this thread because it is exactly what I'm
>> >> >having
>> >> >a
>> >> > problem with - performing calculations using merge fields. I have
>> >> > become
>> >> > accustomed to getting yelled at by moderators for starting another
>> >> > thread
>> >> > with the same subject, so I opted to post under this. Sorry if this
>> >> > too
>> >> > is
>> >> > wrong.
>> >> >
>> >> > As for the problem, I don't know how granular you want me to get, so
>> >> > I'll
>> >> > start from the very beginning and apologize if it's long.
>> >> >
>> >> > The document I'm trying to build is an invoice that sales would be
>> >> > able
>> >> > to
>> >> > generate invoices with from our sales system. Searching the
>> >> > internet,
>> >> > I
>> >> > came
>> >> > upon a template that seemed like what I was looking for. One row
>> >> > across
>> >> > citing Product Name, Product Unit Price and the last giving the
>> >> > Total
>> >> > Price
>> >> > for the product. A Grand Total column totals all the lines above it
>> >> > using
>> >> > =SUM(TOTAL). As our product is a software service sold on a yearly
>> >> > basis,
>> >> > it
>> >> > would be ideal to have some way for the one template to accommodate
>> >> > every
>> >> > multi-year scenario we have. I used the ASK code to prompt the user
>> >> > to
>> >> > enter
>> >> > in the number of years that the deal was for. This value is stored
>> >> > in
>> >> > a
>> >> > bookmark called YEARS, and this in turn is used in a field that
>> >> > calculates
>> >> > the cost per year.
>> >> >
>> >> > So far as I can tell, I need the proper syntax to multiply a
>> >> > mergefield
>> >> > by
>> >> > a
>> >> > bookmark and have it format as a dollar amount. I need to multiply
>> >> > the
>> >> > Product Unit Price mergefield by the value entered into the YEARS
>> >> > bookmark
>> >> > by
>> >> > the user to get the Total Price for each product on each line of the
>> >> > invoice.
>> >> > Adding a quantity field with a fixed number is not possible because
>> >> > of
>> >> > the
>> >> > way finance set up the sales system. I found a page in the
>> >> > Microsoft
>> >> > Help
>> >> > and Support site titled "WD: Performing Calculations in a Mail Merge
>> >> > Field"
>> >> > which had some examples of calculations, but every time I try
>> >> > entering
>> >> > the
>> >> > formulas into the word document, it gives me the "!SyntaxError"
>> >> > message.
>> >> >
>> >> > I hope this explains my problem better and thank you for any help
>> >> > you
>> >> > can
>> >> > give me.
>> >> >
>> >> > "Doug Robbins - Word MVP" wrote:
>> >> >
>> >> >> Is this a continuation of the original thread under which it
>> >> >> appears
>> >> >> or a
>> >> >> new and different situation.
>> >> >>
>> >> >> You need to give full information of what you are starting with and
>> >> >> what
>> >> >> you
>> >> >> want to achieve if you want to get assistance that will lead to a
>> >> >> solution
>> >> >> of your problem. Sometimes, just describing the way that you have
>> >> >> going
>> >> >> about trying to achieve something is not sufficient, particularly
>> >> >> when,
>> >> >> with
>> >> >> the full knowledge of what it is, that turns out to either an
>> >> >> inappropriate,
>> >> >> or at least not the best method of going about it.
>> >> >>
>> >> >> --
>> >> >> Regards.
>> >> >>
>> >> >> Please reply to the newsgroup unless you wish to avail yourself of
>> >> >> my
>> >> >> services on a paid consulting basis.
>> >> >>
>> >> >> Doug Robbins - Word MVP
>> >> >>
>> >> >> "thatangrykid" <thatangrykid[ at ]discussions.microsoft.com> wrote in
>> >> >> message
>> >> >> news:485FB6C8-4AF6-4A22-91B4-FAB379B93560[ at ]microsoft.com...
>> >> >> > Hi,
>> >> >> > I've been smashing my head against the cube wall for the past few
>> >> >> > days
>> >> >> > trying to get a calculation out of the mail merge fields I have
>> >> >> > set
>> >> >> > up
>> >> >> > in
>> >> >> > a
>> >> >> > table. I have harnessed the power of =SUM(ABOVE) to get my Grand
>> >> >> > Total,
>> >> >> > and
>> >> >> > I also discovered the Bookmark function so that the users can
>> >> >> > enter
>> >> >> > in
>> >> >> > the
>> >> >> > number of years the deal is for and have used that number for
>> >> >> > calculations.
>> >> >> > But in order to express the Total for each product, I can't seem
>> >> >> > to
>> >> >> > figure
>> >> >> > out a way to take the Bookmarked quantity number and multiply it
>> >> >> > by
>> >> >> > the
>> >> >> > Unit
>> >> >> > Price without getting an error message during the merge.
>> >> >
>> >>
>> >>
>> >>
>>
>>
>>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net