another "if" "then" question

J

jnsaunders

I would like a micro to evaluate say cell B7

If B7 has a value of 1 Macro A is invoked
If B7 has a value of 2 Macro B is invoked
If B7 has a value of 3 Macro C is invoked

I do I accomplish this?

Thx
 
J

jnsaunders

Function Bonus(performance, salary)
Select Case performance
Case 1
Bonus = salary * 0.1
Case 2, 3
Bonus = salary * 0.09
Case 4 To 6
Bonus = salary * 0.07
Case Is > 8
Bonus = 100
Case Else
Bonus = 0
End Select
End Function
Presumably performance is a range with numeric value that is being
evaluated? I am confused how to do this.
 
B

Bob Phillips

performance can be a value , 1,2,3 , etc., or a cell reference containing
that value. Diito salary.

So it can be

=Bonus(1,1000)

or

=Bonus(a1,A2)

or a mix of them

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
Top