Hi all
I am doing a finance course, with quite a few formulas constructed in VBA (fx. The Black-Scholes formula etc.)
However, when there are +40 functions, it can be hard to remember what inputs are supposed to be place first, last etc. in the formula in the Excel Cell.
So I have been searching for a way to show the name of the input between the ( Semicolons which splits up the different inputs in the formula.
so when I type the function I have written in Excel:
=BSCallPrice(Input1;Input2;input3;input4;input5) it is blank, but is there a a way to name the inputs like when using Formula NPV which shows : NPV(Rate;value1;value2;...)
So I know that the first input is the rate.
In excel it should show : =BSCallPrice(S;X;T;i;sigma) so I know in which sequence my inputs should be typed.
Hope it makes sense Any help would be very appreciated.
I am doing a finance course, with quite a few formulas constructed in VBA (fx. The Black-Scholes formula etc.)
However, when there are +40 functions, it can be hard to remember what inputs are supposed to be place first, last etc. in the formula in the Excel Cell.
So I have been searching for a way to show the name of the input between the ( Semicolons which splits up the different inputs in the formula.
so when I type the function I have written in Excel:
=BSCallPrice(Input1;Input2;input3;input4;input5) it is blank, but is there a a way to name the inputs like when using Formula NPV which shows : NPV(Rate;value1;value2;...)
So I know that the first input is the rate.
In excel it should show : =BSCallPrice(S;X;T;i;sigma) so I know in which sequence my inputs should be typed.
Code:
Function BSCallPrice(S, x, T, i, sigma)
' Calculates Black-Scholes call price
'S: Stock price
'X: Exercise price
'T: Time to maturity
'i: Interest rate
'sigma: standard deviation
Dim d1, d2, Nd1, Nd2
d1 = (Log(S / x) + (i + 0.5 * sigma ^ 2) * T) / (sigma * Sqr(T))
d2 = d1 - sigma * Sqr(T)
Nd1 = Application.NormSDist(d1)
Nd2 = Application.NormSDist(d2)
BSCallPrice = S * Nd1 - x * Exp(-i * T) * Nd2
End Function
Hope it makes sense Any help would be very appreciated.