I would like to create a library of functions. Some of the functions will call other custom functions (to save code replication). However, I can't seem to get the functions to work together. The code is contained within one module.
In the code below, the function "Prepay" works just fine. However, when I call the function "Ticks" I get "#Name?". But, when I use the function wizard f(x), the function is recognized (I can see the wizard is looking for CF, Speed, and Price) as inputs.
Public Function Ticks(CF As Single, CPR As Single, Price As Single) As Single
Ticks = CF * Prepay(CPR) * (Price / 100 - 1) / CF * 3200
End Function
Public Function Prepay(CPR As Single) As Single
CPR = CPR / 100
Prepay = (1 - (1 - CPR) ^ (1 / 12))
End Function
In the code below, the function "Prepay" works just fine. However, when I call the function "Ticks" I get "#Name?". But, when I use the function wizard f(x), the function is recognized (I can see the wizard is looking for CF, Speed, and Price) as inputs.
Public Function Ticks(CF As Single, CPR As Single, Price As Single) As Single
Ticks = CF * Prepay(CPR) * (Price / 100 - 1) / CF * 3200
End Function
Public Function Prepay(CPR As Single) As Single
CPR = CPR / 100
Prepay = (1 - (1 - CPR) ^ (1 / 12))
End Function