### Formula 17

#### Operators/Functions Used

If-Then-Else, Remainder, ToNumber, Equal (=), Parentheses ()

#### Formula Purpose

A retailer wants to test two different direct mail offers to see which one has the best "pulling" power. He wants to send one offer to all customers on his mailing list with even customer numbers and the second offer to all customers with odd customer numbers.

#### Formula

    If Remainder(ToNumber({file.CUSTNUM}), 2 )= 0 Then

        {file.OFFER1}

    Else

        {file.OFFER2}

#### Results

Cust # | Remainder | Result
203104 | 0 | Offer 1 - "You are entitled to a 10% discount."
203105 | 1 | Offer 2 - "You are entitled to a free gift."

#### Explanation

- The ToNumber function converts the customer number (stored as text) to a number.
- The Remainder function takes that number, divides it by 2, and returns a remainder.
- The Equal operator tests the remainder to see if it is equal to 0.
- If the remainder is equal to zero, the customer number is divisible by two and thus an even number triggering the printing of {file.OFFER1}.
- If the remainder is not equal to zero, the customer number is not evenly divisible by two and thus an odd number, triggering the printing of {file.OFFER2}.

###### Related topics

Formulas In Action

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