Hi all,
I keep having format problem with this very simple function.
Could you help?
'=========================
Function CAGR(Values As range) As Long
YrTotal = Values.Count
StartValue = Values(0)
EndValue = Values(YrTotal)
For Each cell In Values
If Application.IsErr(cell.Value) Then
ErrCode = CStr(cell.Value)
CAGR = CVErr(Right(ErrCode, Len(ErrCode) - InStr(ErrCode, " "
))
Exit Function
End If
Next
CAGR = Sqr((EndValue / StartValue - 1))
On Error Resume Next
End Function
'=============================
I keep having format problem with this very simple function.
Could you help?
'=========================
Function CAGR(Values As range) As Long
YrTotal = Values.Count
StartValue = Values(0)
EndValue = Values(YrTotal)
For Each cell In Values
If Application.IsErr(cell.Value) Then
ErrCode = CStr(cell.Value)
CAGR = CVErr(Right(ErrCode, Len(ErrCode) - InStr(ErrCode, " "
Exit Function
End If
Next
CAGR = Sqr((EndValue / StartValue - 1))
On Error Resume Next
End Function
'=============================