Commission code
Posted by Chris on April 02, 2001 8:48 AM
I am writing a function that will calculate the commission payable to an employee if a certain sales target is made. following is the code and it doesnt seem to work.
Chris
Function Commission(Sale, How_Big)
'
'Calculates the commision to be paid to the employees
'
Commission_Rate1 = 0.15
Commission_Rate2 = 0.23
yes = "yes"
If Sale = "yes" Then
If Sale <= 500 Then
Commission = 0
If Sale <= 1000 Then
Commission = How_Big * Commission_Rate1
If Sale >= 1500 Then
Commission = How_Big * Commission_Rate2
Else
Commission = 0
End If
End If
End If
End If
Commission = Application.Round(Commission,2) 'Round for currency
End Function