** I may have original posted this in the wrong forum.
I'm having trouble coming up with a function that would accomplish the math equation below.
_______________________
Returns are:
5%, 10%, 15%, 20%
_______________________
The equation to link the returns is:
(1+5%)*(1+10%)*(1+15%)*(1+20%)-1
_______________________
No matter what I tried I just can't get the code to work. Should I us an Array or Just a Range, For Next? Any help would be appreciated.
Function LINKADD(rRange As Range)
Dim i As Variant
Dim rLink As Variant
Dim rLink2 As Variant
For Each i In rRange
rLink = rLink + 1
rLink2 = rLink * rLink
Next i
LINKADD = rLink2 - 1
End Function
Bookmarks