Hi I am trying to create a custom function to calculate bonuses for
asset managers. I am having problems getting excel to calculate when
the percentages are equal. The code works when using > or < but not
>= or <=. I have also tried using the ROUND function to round the
percentages off. Any ideas?
Function PerformanceOneYear(ACM_Perform As Single, BESA1yr As Single,
Bases_Points As Single, _
Limit As Single, GrowthValue1yr As Currency, Max_Bonus As Currency)
'Calculates the Performance bonus for 1 year period
'ACM_Perfom is the Asset Managaer's growth perfomance for the year as
a percentage
'BESA1yr is the BESA index for the year as a percentage
'Bases_Points is the percentage above the BESA index required for a
Bonus
'Max_Bonus is the maximum currency value of the bonus payable
'Limit is the maximum percentage above BESA index payable for bonus
If ACM_Perform >= (BESA1yr + Bases_Points) Then
If (ACM_Perform - (BESA1yr + Bases_Points)) <= Limit Then
If ((ACM_Perform - (BESA1yr + Bases_Points)) *
GrowthValue1yr) < Max_Bonus Then
PerformanceOneYear = (ACM_Perform - (BESA1yr +
Bases_Points)) * GrowthValue1yr
Else
PerformanceOneYear = Max_Bonus
End If
Else
If ((BESA1yr + Limit) - (BESA1yr + Bases_Points)) *
GrowthValue1yr < MaxBonus Then
PerformanceOneYear = ((BESA1yr + Limit) - (BESA1yr +
Bases_Points)) * GrowthValue1yr
Else
PerformanceOneYear = Max_Bonus
End If
PerformanceOneYear = "No Performance Bonus"
End If
Else
PerformanceOneYear = "No Performance Bonus"
End If
End Function
Thanks
Heather
Bookmarks