IF to Test a Value

P

prkhan56

Hello All,
I posted this yesterday but cannot see it in the group.. so posting the
problem again

I am using Windows XP/Office 2003 and have the following problem:

I have a MailMerge Document .. The data is in Excel

I wish to test the Fieldname 'CONT' shown at the top of the merge
document. The value will be from 1 to 5 and 'RATE' is shown in
five different places.

For Eg If CONT = 2

RATE in first and second place should show the value from the Excel
file, and should show blank in third, fourth and fifth place..
similarly if CONT = 4 . .. then the fifth RATE will be blank

I tried something like this for CONT = 2 but did not succeed.. I have
used Ctrl F9 for inserting the field
{IF{MERGEFIELD "CONT" > 1 ={MERGEFIELD "RATE" \# 0.00}"
""}

I would like to do the same for upto CONT = 5

Can anybody give me a clue please

TIA

Rashid
 
G

Greg

You will need a differnt field code for each rate expression:

{ IF {MERGEFIELD YourMergeField } >= "1"{MERGEFIELD
YourOtherMergeField}}
{ IF {MERGEFIELD YourMergeField } >= "2"{MERGEFIELD
YourOtherMergeField}}
etc.
 
G

Graham Mayor

Hmmm

{ IF {MERGEFIELD YourMergeField } = "1" "{MERGEFIELD
YourOtherMergeField}"}{ IF {MERGEFIELD YourMergeField } = "2" "{MERGEFIELD
YourOtherMergeField}"}etc

might be nearer the mark. If you use >= you would get multiple entries.

All the relevant conditional fields follow one another on the same line

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
P

prkhan56

Hi Greg
I got it working.

I would also try Graham's suggestion

Thanks to both of you
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top