Basically, I am trying to create a function that returns the total return for an array of numbers. Here is an example of the formula;
((1+.25/100)*(1+.5/100)*(1+1.5/100)-1)*100
The forumula in excel would look something like this;
=(Product(A1:C1/100+1)-1)*100 given A1=.25,B1=.5,C1=1.5
Function Totaltreturn(rngRange As Range)
Dim vbCell As Range
For Each vbCell In rngRange
Totalreturn = (Product((Totalreturn * vbCell) / 100 + 1) - 1) * 100
Next vbCell
End Function
I started this code but am an amateur to vba so I am probably missing something quite basic. Please let me know, thank you in advance for your help.
((1+.25/100)*(1+.5/100)*(1+1.5/100)-1)*100
The forumula in excel would look something like this;
=(Product(A1:C1/100+1)-1)*100 given A1=.25,B1=.5,C1=1.5
Function Totaltreturn(rngRange As Range)
Dim vbCell As Range
For Each vbCell In rngRange
Totalreturn = (Product((Totalreturn * vbCell) / 100 + 1) - 1) * 100
Next vbCell
End Function
I started this code but am an amateur to vba so I am probably missing something quite basic. Please let me know, thank you in advance for your help.