Formula 2

Operators/Functions Used

If-Then-Else, Subscript [], Less Than (<), Concatenate (+), Make range (to), ToNumber, Subtract (-), ToText, Parentheses ()

Formula Purpose

You have the date of first purchase coded as the fourth and fifth characters of the customer number (for example, 1971 as the 71 in ABC7101234, 1988 coded as the 88 in ABC880544, etc.) and you want to customize a letter to thank customers for the number of years they have done business with you. You want the following sentence to appear in your letter:

"You have been a valued customer for" [x] "years."
«Where x is the number of years.»

Formula

If {file.CUSTOMER NUMBER}[4 to 5] < "90" Then
"You have been a valued customer for " + ToText(91
- ToNumber({file.CUSTOMER NUMBER}[4 to 5]))
+ " years."
Else 
"You are one of our newer customers, and we want you to 
know how valuable you are to us."

Result

Customer # Resulting Sentence

ABC7801234

"You have been a valued customer for 13 years."

ABD890337

"You have been a valued customer for 2 years."

ABD904331

"You are one of our newer customers, and we want you to know how valuable you are to us."

Explanation

Related topics

Formulas In Action



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