Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / December 2003

Tip: Looking for answers? Try searching our database.

Is it possible to create nested IF statement?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Matt M - 14 Dec 2003 21:17 GMT
I am trying to create a form with a nested IF statement.  
I am creating a performance appraisal form, so what I need
the nested IF for is to translate the numerical score that
the user enters into the text translation.

Example
"1" = Does not deliver
"2" = Achieved

etc., etc.

I found an article on nested IFs for mail merge which
suggested the following format:

{IF test1 "TrueResult" "{IF
test2 "TrueResult" "FalseResult"}"}

however this is not working.  Anyone have experience
creating something like this?
Greg Maxey - 14 Dec 2003 21:30 GMT
Matt,

Nested IF fields are certainly possible but I can't follow what you are
trying to do.  One thing I don't se is a comparison expressiong (e.g., equal
sign) in your IF field.

Here is one example of a nested IF field:
{ IF BrandName = "Daikin" "Daiken is a generic brand" "{ IF BrandName =
"CONAIC" "Concia is a relatively new brandt" "{ IF BrandName  = "Advil"
"Take two and call me in the moring" "Not a valid brand name" }" } }

Basically makes a comparison (e.g., BrandName " Daikin") and returns first
choice (i.e., Daiken is a generic bran) if the comarion is true or the
sencond choice (in this case another IF comparison) if the comparison is
false.

Signature

Greg Maxey
A peer in "peer to peer" support
Rockledge, FL
To e-mail, edit out the "w...spam" in gmaxey@whamspammvps.org

> I am trying to create a form with a nested IF statement.
> I am creating a performance appraisal form, so what I need
[quoted text clipped - 15 lines]
> however this is not working.  Anyone have experience
> creating something like this?
mcelhatt@yahoo.com - 14 Dec 2003 23:20 GMT
Greg-

Thanks for your response. What you are descibing is
definitely what I am trying to achieve.  When I tried to
replicate you example in Word, it was not successful.  
Basically, the result was simply a concatenated version of
what I typed in.  After I entered in your example, and
selected "Update Field" - the result was "not a valid
brand name" when I selected "toggle field code" the
formula was then changed to the following:

{IF BrandName = "CONCIA" "Concia is a relatively new
brand" "Not a valid brand name"}

I am entering in the field braces using CTRL F9, is that
correct?

>-----Original Message-----
>Matt,
[quoted text clipped - 34 lines]
>
>.
Peter Jamieson - 15 Dec 2003 10:28 GMT
If BrandName is the name of a bookmark (e.g. as defined in the form field
properties) I'd use

{ IF { REF BrandName } = "CONCIA" "Concia is a relatively new
brand" "Not a valid brand name" }

or even

{ IF "{ REF BrandName }" = "CONCIA" "Concia is a relatively new
brand" "Not a valid brand name" }

Ensure that the "=" sign has a space on each side.

But I'd also want to be sure that the bookmark BrandName actually contained
the exact value "CONCIA" (e.g. not "Concia") at the time I executed the IF
field, or use e.g.

{ IF "{ REF BrandName \*Upper }" = "CONCIA" "Concia is a relatively new
brand" "Not a valid brand name" }

If you are getting your BrandName from a merge data source, you'd need

{ IF "{ MERGEFIELD BrandName }" = "CONCIA" "Concia is a relatively new
brand" "Not a valid brand name" }

> I am entering in the field braces using CTRL F9, is that
> correct?

Yes - when you nest fields, /all/ the field braces need to be these special
characters, not the ordinary keyboard {}

--
Peter Jamieson - Word MVP

> Greg-
>
[quoted text clipped - 68 lines]
> >
> >.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.