Using OR and AND

C

Cathy

How do you complete the following in Word 2002:

I have a mergefield that has different values. What I need
to show in Word will depend on the value.

If mergefield test="DOE" or mergefield test="DAY" or
mergefield test="HIGH" then show "Start".

else if mergefield test="LOW" then show "End"

else if mergefield test="HIGH" then show "Begin"

I just started learning mergefields yesterday so all help
would be appreciated.

Thanks
 
D

Doug Robbins - Word MVP

Hi Cathy,

Ignoring the error in your statements, use the following field construction

{ IF { MERGEFIELD "test" } = "DOE" "Start" { IF { MERGEFIELD "test" } =
"DAY" "Start" { IF { MERGEFIELD "test" } = "HIGH" "Start" "End" } } }

You must use Ctrl + F9 for each pair of { }

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
C

Cathy

Sorry but I made a mistake in some of my explanation on my
original post.

1. If {mergefield test}="DOE" or {mergefield test}="DAY"
or mergefield test="HIGH" then show "Start".

Here are the corrections:

2. else if {mergefield test}="LOW" and {mergefield testtwo}
="1" (there are actually a list of numbers and not
just "1") and {mergefield testthree}="JANE" then show "End"

3. else if mergefield test="MIDDLE" then show "Begin"

Thanks Doug for helping me. I got the first part of my
formula.

More help would be greatly appreciated.
 
D

Doug Robbins - Word MVP

Hi Cathy,

This maybe it:

{ IF { MERGEFIELD "test" } = "DOE" "Start" { IF { MERGEFIELD "test" } =
"DAY" "Start" { IF { MERGEFIELD "test" } = "HIGH" "Start" { IF { MERGEFIELD
"test" } = "LOW" { IF { MERGEFIELD "testtwo" } = 1 { IF { MERGEFIELD
"testthree"} = "JANE" "End" "Begin"}}}}}}

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 

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