Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
cpeiner cpeiner is offline
external usenet poster
 
Posts: 3
Default Delete text precending an empty/zeroed merge field?

I hav created a number of documents which include up to 3 profit ranges,
such as this:

From «Start_Range_1» to «End_Range_1» = «Percentage_1»
From «Start_Range_2» to «End_Range_2» = «Percentage_2»
From «Start_Range_3» to «End_Range_3» = «Percentage_3»

In many cases only one or two ranges are used, leaving the other
ranges/percentages empty, which generates the following result:

From £2,000,000 to £3,000,000 = 1.00%
From £3,000,000 to £6,000,000 = 0.50%
From £ 0 to £ 0 0.00% = 0.00%

Is there a way to make Word delete the preceding text when the next field is
emply? I'm fairly new to MailMerge, so I don't know much about IF functions
outside of Excel.

Any help is greatly appreciated. Cheers!
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Delete text precending an empty/zeroed merge field?

In this case you may be able to use something like

{ IF { ={ MERGEFIELD Start_Range_2 \#0 }+{ MERGEFIELD End_Range_2 \#0 } } =
0
""
"
From { MERGEFIELD Start_Range_2 } to { MERGEFIELD End_Range_2 } = {
MERGEFIELD Percentage_3 }" }

where all the {} are the special field code braces you can enter using
ctrl-F9. However, you may need to vary this depending on what the actual
condition needs to be if the values are not present, etc. If you can't make
head or tail of that, it would probably help if you could post the exact
fields you have at present.

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

"cpeiner" wrote in message
...
I hav created a number of documents which include up to 3 profit ranges,
such as this:

From «Start_Range_1» to «End_Range_1» = «Percentage_1»
From «Start_Range_2» to «End_Range_2» = «Percentage_2»
From «Start_Range_3» to «End_Range_3» = «Percentage_3»

In many cases only one or two ranges are used, leaving the other
ranges/percentages empty, which generates the following result:

From £2,000,000 to £3,000,000 = 1.00%
From £3,000,000 to £6,000,000 = 0.50%
From £ 0 to £ 0 0.00% = 0.00%

Is there a way to make Word delete the preceding text when the next field
is
emply? I'm fairly new to MailMerge, so I don't know much about IF
functions
outside of Excel.

Any help is greatly appreciated. Cheers!


  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
cpeiner cpeiner is offline
external usenet poster
 
Posts: 3
Default Delete text precending an empty/zeroed merge field?

Peter,

thanks for the advice. I went back and rearranged the lay-out to a table, so
now the "From | To | Percentage | Total" is on top and I don't have to worry
about it anymore. So now all I need is to tell Word that if it receives a 0,
the field should stay empty.

The total field code in the four cells is this:

Cell 1: {Mergefield "Start_Range_3" \# ###,0}
Cell 2: {Mergefield "End_Range_3" \# ###,0}
Cell3: {={Mergefield Percentage_3}*100 \# "0.00%"}
Cell4: {Mergefield "Possible_Bonus_Amount_Range_3" \# £###,0}

Of course I have the same fields for Ranges 1 and 2.

Looking at your function, I was thinking to use somthing along the lines of:
{ IF { ={ MERGEFIELD Start_Range_2 \#0} } = 0 "" (and this is where I don't
know any further ELSE { MERGEFIELD Start_Range_2 \#0 }.

I would then just repeat this process in all merge-cells. So how can I write
it so that word understands IF MERGE_CELL=0, DISPLAY "", DISPLAY "MERGEFIELD
Start_Range_2"?

Many thanks!



"Peter Jamieson" wrote:

In this case you may be able to use something like

{ IF { ={ MERGEFIELD Start_Range_2 \#0 }+{ MERGEFIELD End_Range_2 \#0 } } =
0
""
"
From { MERGEFIELD Start_Range_2 } to { MERGEFIELD End_Range_2 } = {
MERGEFIELD Percentage_3 }" }

where all the {} are the special field code braces you can enter using
ctrl-F9. However, you may need to vary this depending on what the actual
condition needs to be if the values are not present, etc. If you can't make
head or tail of that, it would probably help if you could post the exact
fields you have at present.

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

"cpeiner" wrote in message
...
I hav created a number of documents which include up to 3 profit ranges,
such as this:

From «Start_Range_1» to «End_Range_1» = «Percentage_1»
From «Start_Range_2» to «End_Range_2» = «Percentage_2»
From «Start_Range_3» to «End_Range_3» = «Percentage_3»

In many cases only one or two ranges are used, leaving the other
ranges/percentages empty, which generates the following result:

From £2,000,000 to £3,000,000 = 1.00%
From £3,000,000 to £6,000,000 = 0.50%
From £ 0 to £ 0 0.00% = 0.00%

Is there a way to make Word delete the preceding text when the next field
is
emply? I'm fairly new to MailMerge, so I don't know much about IF
functions
outside of Excel.

Any help is greatly appreciated. Cheers!



  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Delete text precending an empty/zeroed merge field?

If you are just displaying numbers or blanks, you should be able to use the
numeric field switches (this stuff's in the Word Help file, or used to be)
to do this:

{ MERGEFIELD fieldname \#"p;n;z" }

where p is the format you want for positive values, n is the format for
negative values and z is the format for 0.

e.g.

{ MERGEFIELD fieldname \#"£,0.00;(£,0.00);" }

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

"cpeiner" wrote in message
...
Peter,

thanks for the advice. I went back and rearranged the lay-out to a table,
so
now the "From | To | Percentage | Total" is on top and I don't have to
worry
about it anymore. So now all I need is to tell Word that if it receives a
0,
the field should stay empty.

The total field code in the four cells is this:

Cell 1: {Mergefield "Start_Range_3" \# ###,0}
Cell 2: {Mergefield "End_Range_3" \# ###,0}
Cell3: {={Mergefield Percentage_3}*100 \# "0.00%"}
Cell4: {Mergefield "Possible_Bonus_Amount_Range_3" \# £###,0}

Of course I have the same fields for Ranges 1 and 2.

Looking at your function, I was thinking to use somthing along the lines
of:
{ IF { ={ MERGEFIELD Start_Range_2 \#0} } = 0 "" (and this is where I
don't
know any further ELSE { MERGEFIELD Start_Range_2 \#0 }.

I would then just repeat this process in all merge-cells. So how can I
write
it so that word understands IF MERGE_CELL=0, DISPLAY "", DISPLAY
"MERGEFIELD
Start_Range_2"?

Many thanks!



"Peter Jamieson" wrote:

In this case you may be able to use something like

{ IF { ={ MERGEFIELD Start_Range_2 \#0 }+{ MERGEFIELD End_Range_2 \#0 } }
=
0
""
"
From { MERGEFIELD Start_Range_2 } to { MERGEFIELD End_Range_2 } = {
MERGEFIELD Percentage_3 }" }

where all the {} are the special field code braces you can enter using
ctrl-F9. However, you may need to vary this depending on what the actual
condition needs to be if the values are not present, etc. If you can't
make
head or tail of that, it would probably help if you could post the exact
fields you have at present.

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

"cpeiner" wrote in message
...
I hav created a number of documents which include up to 3 profit
ranges,
such as this:

From «Start_Range_1» to «End_Range_1» = «Percentage_1»
From «Start_Range_2» to «End_Range_2» = «Percentage_2»
From «Start_Range_3» to «End_Range_3» = «Percentage_3»

In many cases only one or two ranges are used, leaving the other
ranges/percentages empty, which generates the following result:

From £2,000,000 to £3,000,000 = 1.00%
From £3,000,000 to £6,000,000 = 0.50%
From £ 0 to £ 0 0.00% = 0.00%

Is there a way to make Word delete the preceding text when the next
field
is
emply? I'm fairly new to MailMerge, so I don't know much about IF
functions
outside of Excel.

Any help is greatly appreciated. Cheers!




  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
cpeiner cpeiner is offline
external usenet poster
 
Posts: 3
Default Delete text precending an empty/zeroed merge field?

Peter,

this is exactly what I was looking for. The Word helpfile was the first
place I looked but either I was unable to search for the correct words or the
Help function was being elusive. Eithe way, thanks for this!

Cheers!

"Peter Jamieson" wrote:

If you are just displaying numbers or blanks, you should be able to use the
numeric field switches (this stuff's in the Word Help file, or used to be)
to do this:

{ MERGEFIELD fieldname \#"p;n;z" }

where p is the format you want for positive values, n is the format for
negative values and z is the format for 0.


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
In Word 2003 when mail merge how do I delete an empty field? connie Mailmerge 3 July 23rd 07 05:25 PM
how do i delete an empty footnote? lrhodes Microsoft Word Help 2 May 27th 06 03:18 PM
auto delete row if empty Alicia Tables 1 October 18th 05 11:20 PM
How do I omit an empty date merge field? Phildeman Microsoft Word Help 5 June 13th 05 03:29 PM
Empty Merge fields then substitute text Mary Mailmerge 1 March 14th 05 12:32 PM


All times are GMT +1. The time now is 07:46 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"