I have a value in cell in cell A1 (0.45) and in B1 I want the output of this function which should be 5.
Function createStakes(rng As Range) As Double
Dim kelly As Double
kelly = rng.Value
Dim stake As Double
kelly = Round(kelly, 3)
Select Case kelly
Case Is <= 0.1
stake = 1
Case Is <= 0.15
stake = 1.5
Case Is <= 0.2
stake = 2
Case Is <= 0.25
stake = 2.5
Case Is <= 0.3
stake = 3
Case Is <= 0.35
stake = 3.5
Case Is <= 0.4
stake = 4
Case Is < 0.45
stake = 4.5
Case Else
stake = 5
End Select
End Function
Nothing is returned. I've tried debugging and the function itself seems to work but the cell has a zero. I've also tried running another module and returning the output of the function as a variable but it always returns a zero?
I've tried other functions which do work so I am not sure what is going wrong?