Formula 4

Operators/Functions Used

Nested formulas, If-Then-Else, Subtract (-), Multiply (*), Greater than (>), Greater than or equal (>=), Sum, Parentheses ()

Formula Purpose

A computer store sells hardware, software, and books. It pays its sales representatives 7% of all hardware sales (monthly) over $5000, 10% of all software sales (monthly) over $10, 000, and 5% of all book sales (monthly) over $1000. The sales manager wants to calculate the commission in each category for each representative, total the commission due each representative, and flag those representatives who are entitled to more than $5000 in total commission for the month. We will do this using nested formulas, that is, using one formula as one of the elements in another formula.

Formula(s)

@HARDWARE

If (({file.HARD SALES}-5000)> 0) Then 
    .07 * ({file.HARD SALES}-5000)
Else
    0

@SOFTWARE

If (({file.SOFT SALES}-10000)> 0) Then 
    .10 * ({file.SOFT SALES}-10000)
Else
    0

@BOOKS

If (({file.BOOK SALES}-1000)> 0) Then 
    .05 * ({file.BOOK SALES}-1000)
Else
    0

@TOTCOMM

Sum([{@HARDWARE}, {@SOFTWARE}, {@BOOKS}])

@FLAG

If {@TOTCOMM} >= 5000 Then 
    " **** "
Else
    ""

Result

Given this data:

Salesrep HardSales SoftSales BookSales

Salesrep A

4500

21000

985

Salesrep B

31427

41222

4470

Salesrep C

22000

4687

4250

Salesrep D

14000

15678

2200

The formulas return the following results:

Salesrep Hardware Software Books Total Flag

SalesrepA

0.00

1100.00

0.00

1100.00


SalesrepB

3122.20

1849.89

173.50

5145.59

****

SalesrepC

1190.00

0.00

162.50

1352.50


SalesrepD

630.00

567.80

60.00

1257.80


Explanation

Related topics

Formulas In Action



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