In the following code
OptionType is either “C” for a call or “P” for a put
S is the stock price
X is the strike price
T is the time to expiry
r is the risk free rate
v is the volatility
d is the dividend yield
Function dOne(S, X, T, r, v, d)
dOne = (Log(S / X) + (r - d + 0.5 * v ^ 2) * T) / (v * (Sqr(T)))
End Function
Function NdOne(S, X, T, r, v, d)
NdOne = Exp(-(dOne(S, X, T, r, v, d) ^ 2) / 2) / (Sqr(2 * Application.WorksheetFunction.Pi()))
End Function
Function dTwo(S, X, T, r, v, d)
dTwo...