View Single Post
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
mj_bowen[_2_] mj_bowen[_2_] is offline
external usenet poster
 
Posts: 1
Default Using IF function for 5 variables

I am an infant school teacher who has recently stumbled upon the uses of mail
merge. I have limited knowledge of format switches and have found advice on
this forum very clear and useful.

I have looked at; Mail merge - Ask / If function posted on 5/5/2006 6:55 AM
PST

http://www.microsoft.com/communities...e34-4b0c-8aba-
2e17252d39bc&lang=en&cr=us&pt=&catlist=&dglist=&pt list=&exp=&sloc=en-us


The data I have merged results in either a four, three, two, or one digit
number appearing in the word doc. I have been trying to use the IF switch to
add letters before the resulting Mergefield number. For example,

1.If the number is 9 or less than 9 (ie, 9 8 7 6 5 4 3 2 1 0) then a U would
appear before the Mergefield number,eg, U9

2.If the number is between 99 and 10 (including 99 and 10) then a T U would
appear before the Mergefield number, eg, TU21

3.If the number is between 999 and 100 (including 999 and 100) then
H T U would appear before the Mergefield number, eg, HTU354

4.If, the number is between 9999 and 1000 (including 999 and 100) the Th H T
U would appear before the Mergefield number, eg,
Th H T U 3437

5. Finally, the Mergefield may sometimes not result in number being
displayed in the word doc, intead a symbol or a word. This symbol or word
will be displayed on its own - without any Th H T U, H T U, T U or U in front
of it.

I have included an example (probably a very crude one of where I am up to!

{ If Qn_1_Red_410=U{MERGEFIELD Qn_1_Red_4} }
I have been trying to use the IF function, and have managed to come up with
the above code, but am stumped further.

Any advice woud be warmly welcomed.

Matthew