Formula 9

Operators/Functions Used

Nested If-Then-Else expressions, NumericText, Subscript, Make Range, Equal to (=), ToNumber, In Range, Parentheses ()

Formula Purpose

A retailer has a customer list that includes both customers living inside the state and customers living in Canada. For customers inside the state, some have 5 digit ZIP codes, others have 9 digit ZIP codes. Canadian customers have Postal Codes beginning with a letter.

The company wants a column on the list that shows the sales tax that needs to be levied on orders from each customer. Local customers (those within the greater metropolitan area) get assigned a 7.5% sales tax (6.5% state and 1% local); customers in the state but outside the metropolitan area are assigned a 6.5% sales tax (state only); and Canadian customers are assigned no sales tax.

Formula

If NumericText({customer.POSTAL CODE}[1 to 5])Then
    If ToNumber({customer.POSTAL CODE}[1 to 5]) in
    92200 to 92399 Then
        "7.5"
    Else
    "6.5"
Else
    "0"

Result

ZIP/Postal Tax Explanation

91134

6.5

Inside state/outside metro area

92305

7.5

Inside state/inside metro area

92288-5423

7.5

Inside state/inside metro area (ZIP + 4)

96544-2333

6.5

Inside state, outside metro area (ZIP + 4)

T5A 9S2

0.0

Canadian customer

Explanation

Comments

These tax figures, rules, and Postal codes are for illustration only; they are not meant to accurately represent state and local taxing regulations.

Related topics

Formulas In Action



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