I'm building a custom function in Excel VBA to receive the nth (here: 5th) element of an array with a Webull distribution. This works, but then I cannot do further computations with the result such as simple multiplication without getting an error.
Function weib(xr, shape, scaler)
n = Application.Weibull_Dist(xr, shape, scaler * 100, 0)
weib = n
End Function
Function good(xr, shape, scaler)
n = Application.Index(Application.Weibull_Dist(xr, shape, scaler * 100, 0), 5, 0)
good = n
End Function
Function nogood(xr, shape, scaler)
n = Application.Index(Application.Weibull_Dist(xr, shape, scaler * 100, 0), 5, 0) * 1
nogood = n
End Function
Why does the "nogood" function not work? It only adds * 1 at the end - how can I fix it?
