Formula 15

Operators/Functions Used

Nested If-Then-Else operators, Not equal (<>), Boolean operator (And), Equal (=), Concatenate (+), Parentheses ().

Formula Purpose

The director of a non-profit health care facility wants to automate the salutation in a letter he is sending to his staff. The staff consists of men and women, and professional and non-professional employees. He wants to be certain that all doctors on staff (M.D., Ph.D., and D.D.S.) are given the form of address "Dr." and all non-doctors are given the form of address appropriate to their gender.

Formula

If {file.DEGREE} <> "Ph.D." And
{file.DEGREE} <>"M.D." And
{file.DEGREE} <>"D.D.S" Then
    If {file.SEX} = "M" Then
        "Dear Mr. " + {file.LNAME}
    Else
        "Dear Ms. " + {file.LNAME}
Else
    "Dear Dr. " + {file.LNAME}

Result

Degree Gender Last Name Salutation

B.A.

F

Jones

"Dear Ms. Jones"

Ph.D.

F

Smith

"Dear Dr. Smith"

M.D.

M

Jackson

"Dear Dr. Jackson"

M.S.

M

Miller

"Dear Mr. Miller"

D.D.S.

F

Johnson

"Dear Dr. Johnson"

Explanation

Related topics

Formulas In Action



Seagate Software, Inc.
http://www.seagatesoftware.com
Please send comments to:
techpubs@seagatesoftware.com