sfsteve002
Board Regular
- Joined
- Apr 10, 2011
- Messages
- 114
Hi, I'm trying to create the custom function below, but it does not work. I can't seem to figure out what I'm doing wrong. Can someone help?
Function SB1Calculation(Actual, Goal, OTV)
Dim Tier1 As Integer
Dim Tier2 As Integer
Dim Tier3 As Integer
Dim Tier4 As Integer
Dim SB1Calculation As Integer
Tier1 = (0.75 * OTV) / Goal
If Actual >= Goal Then
Tier2 = Max(Min(Actual - Goal, Goal * 1.15), 0) * (2 * ((0.75 * OTV) / Goal))
Else
Tier2 = 0
End If
If Actual >= Goal * 1.15 Then
Tier3 = Max(Min(((Actual - Goal) * 1.15), Goal * 0.15), 0) * (4 * ((0.75 * OTV) / Goal))
Else
Tier3 = 0
End If
If Actual > (2 * Goal) Then
Tier4 = (Actual - (2 * Goal)) * (0.75 * (OTV / Goal))
Else
Tier4 = 0
End If
SB1Commission = Tier1 + Tier2 + Tier3 + Tier4
End Function
Thanks,
Function SB1Calculation(Actual, Goal, OTV)
Dim Tier1 As Integer
Dim Tier2 As Integer
Dim Tier3 As Integer
Dim Tier4 As Integer
Dim SB1Calculation As Integer
Tier1 = (0.75 * OTV) / Goal
If Actual >= Goal Then
Tier2 = Max(Min(Actual - Goal, Goal * 1.15), 0) * (2 * ((0.75 * OTV) / Goal))
Else
Tier2 = 0
End If
If Actual >= Goal * 1.15 Then
Tier3 = Max(Min(((Actual - Goal) * 1.15), Goal * 0.15), 0) * (4 * ((0.75 * OTV) / Goal))
Else
Tier3 = 0
End If
If Actual > (2 * Goal) Then
Tier4 = (Actual - (2 * Goal)) * (0.75 * (OTV / Goal))
Else
Tier4 = 0
End If
SB1Commission = Tier1 + Tier2 + Tier3 + Tier4
End Function
Thanks,