Attribute VB_Name = "Module2" Public Function exchangeoption(sa, sb, rho, r, sga, sgb, t) b2 = (sga ^ 2 - 2 * rho * sga * sgb + sgb ^ 2) * t d1 = (Log(sa / sb) + b2 / 2) / Sqr(b2) d2 = d1 - Sqr(b2) nd1 = Application.WorksheetFunction.NormSDist(d1) nd2 = Application.WorksheetFunction.NormSDist(d2) exchangeoption = sa * nd1 - sb * nd2 End Function Public Function gapcall(s, k1, k2, r, sg, t) d1 = (Log(s / k2) + (r + sg ^ 2) * t) / Sqr(t) / sg d2 = d1 - sg * Sqr(t) nd1 = Application.WorksheetFunction.NormSDist(d1) nd2 = Application.WorksheetFunction.NormSDist(d2) gapcall = s * nd1 - k1 * Exp(-r * t) * nd2 End Function