Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Calculations in a mergefield.
I have a mergefield called AnnualPremium. How can i calculate the
MonthlyPremium from this. I've tried { =AnnualPremium/12 } but that doesn't work. I haven't found any examples of how to do this on the web but i'm sure there's an easy solution for how to do it. Thanks in advance, Daryl |
#2
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Calculations in a mergefield.
Use
{ = { MERGEFIELD AnnualPremium } \ 12 } Each pair of field delimiters must be inserted by using Ctrl+F9. To make sure you get the { MERGEFIELD AnnualPremium } correct, you can insert the field from the Insert Merge Fields pull down which will give you AnnualPremium Then when you press Alt+F9 to toggle the display of field codes, you will see { MERGEFIELD AnnualPremium } Select that and then press Ctrl+F9 and you will then get { { MERGEFIELD AnnualPremium } } which you can then edit to give the construction first shown above. You may also need to add a formatting switch. { = { MERGEFIELD AnnualPremium } \ 12 \# "$#,###.00" } For more on formatting fields, See "Formatting Word fields with switches" on fellow MVP Graham Mayor's website at http://www.gmayor.com/formatting_word_fields.htm -- 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 wrote in message oups.com... I have a mergefield called AnnualPremium. How can i calculate the MonthlyPremium from this. I've tried { =AnnualPremium/12 } but that doesn't work. I haven't found any examples of how to do this on the web but i'm sure there's an easy solution for how to do it. Thanks in advance, Daryl |
#3
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Calculations in a mergefield.
You are right. That won't work You need to combine your mergefield with a
formula field thus {=({Mergefield AnnualPremium} / 12) \# "$,0.00"} Insert the {} bracket pairs with CTRL+F9 and type the rest. Then F9 and ALT+F9 to update and if necessary toggle the display. There are some examples at http://www.gmayor.com/formatting_word_fields.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org wrote: I have a mergefield called AnnualPremium. How can i calculate the MonthlyPremium from this. I've tried { =AnnualPremium/12 } but that doesn't work. I haven't found any examples of how to do this on the web but i'm sure there's an easy solution for how to do it. Thanks in advance, Daryl |
#4
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Calculations in a mergefield.
Excellent thanks. I didn't have the mergefield embedded in another F9.
|
#5
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Calculations in a mergefield.
Actually, now that i've tried it, it's not working. Here's the text
below. I'm trying to divide a field by 5000 { = ({MERGEFIELD CoverageLevel \# "#" \* MERGEFORMAT } \ 5000 } and it says Syntax error. I've tried it formatting as dollars, and without formatting, but it's either coming through as Syntax Error or as 5000. Any thoughts? Thanks in advance. Daryl |
#6
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Calculations in a mergefield.
sorry was missing a comma in the above merge field. What i'm seeing
after some tinkering is this. I'll enter a formula, it will evaluate correctly once, and thereafter when i try and view it it will show up as Syntax Error!. When i try and update, it says it cannot update one of the fields on the screen, but i can't for the life of me see why it won't update it. Here's another look at what i've tried: The following statement below works. But if i try and embed that in another CTRL-F9, it says it cannot update it: { IF { {MERGEFIELD CoverageLevel} "" "{MERGEFIELD CI_AR_CoverageLevel}" "0" } This is the statement with the added formula condition. Word says it cannot update the field. { = { IF { {MERGEFIELD CoverageLevel} "" "{MERGEFIELD CI_AR_CoverageLevel}" "0" } * 2 } { = { IF { {MERGEFIELD CoverageLevel} "" "{MERGEFIELD CI_AR_CoverageLevel}" "0" } * 2 \# "##" } I've tried it with and without calculations, i'm stumped. Thanks in advance for any suggestions. What is it about adding the Formula part that it fails to update? |
#7
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Calculations in a mergefield.
Use
{ IF { {MERGEFIELD CoverageLevel} "" { = ({MERGEFIELD CI_AR_CoverageLevel}* 2) \# "##" } 0 } -- 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 wrote in message oups.com... sorry was missing a comma in the above merge field. What i'm seeing after some tinkering is this. I'll enter a formula, it will evaluate correctly once, and thereafter when i try and view it it will show up as Syntax Error!. When i try and update, it says it cannot update one of the fields on the screen, but i can't for the life of me see why it won't update it. Here's another look at what i've tried: The following statement below works. But if i try and embed that in another CTRL-F9, it says it cannot update it: { IF { {MERGEFIELD CoverageLevel} "" "{MERGEFIELD CI_AR_CoverageLevel}" "0" } This is the statement with the added formula condition. Word says it cannot update the field. { = { IF { {MERGEFIELD CoverageLevel} "" "{MERGEFIELD CI_AR_CoverageLevel}" "0" } * 2 } { = { IF { {MERGEFIELD CoverageLevel} "" "{MERGEFIELD CI_AR_CoverageLevel}" "0" } * 2 \# "##" } I've tried it with and without calculations, i'm stumped. Thanks in advance for any suggestions. What is it about adding the Formula part that it fails to update? |
#8
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Calculations in a mergefield.
What you posted
{ = ({MERGEFIELD CoverageLevel \# "#" \* MERGEFORMAT } \ 5000 } is nothing like the example that Graham provided, which was {=({Mergefield AnnualPremium} / 12) \# "$,0.00"} What you need is: { = ({MERGEFIELD CoverageLevel } / 5000) \# $,0.00"} -- 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 wrote in message oups.com... Actually, now that i've tried it, it's not working. Here's the text below. I'm trying to divide a field by 5000 { = ({MERGEFIELD CoverageLevel \# "#" \* MERGEFORMAT } \ 5000 } and it says Syntax error. I've tried it formatting as dollars, and without formatting, but it's either coming through as Syntax Error or as 5000. Any thoughts? Thanks in advance. Daryl |
#9
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Calculations in a mergefield.
Sorry for the confusion. I was posting about this mergefield i was
currently trying to get to work. The annual premium field i was able to get the input source to give me both Monthly and Annually premiums so that was how i was able to avoid that one. However, i did the following to insert the above formula and i still get a Syntax error when i CTRL-A and hit F9 to update. Here is the verbatim text from the mergefield, with field codes on. I have no idea why this is giving me such trouble. I use nested IFs, compares, etc. with no issue, but cannot get even the simplest Calculation to work. hit CTRL F9 {} insert a mergefield {{MERGEFIELD CoverageLevel}} add the = and Parenthesis { = ({MERGEFIELD CoverageLevel} ) } add the calculation { = ({MERGEFIELD CoverageLevel} / 5000) } add the formatting to the end ( i use this formatting all over, so it can't be this) { = ({MERGEFIELD CoverageLevel} / 5000) \# "$,0.00" } I believe that's the same as above, but it still gives me errors. There has to be something in the order that i'm inserting the field/calculation/braces that word doesn't like. I tried Graham's statement as well, but i get a syntax error with that one too. Thanks again, Daryl |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
MERGEFIELD error | Page Layout | |||
mail merge - different last names? | Microsoft Word Help | |||
Imbedded MERGEFIELD in IF/ELSE/THEN field | Mailmerge | |||
How do I do a conditional mail merge into a table | Mailmerge | |||
Math In Merge Field(s) | Mailmerge |