Before Entering the Midterm Exam Room
Reading the midterm sheets step by step: no-arbitrage option prices, tree recursion, VBA control flow, GBM simulation, Monte Carlo and checks on the Black-Scholes code.
Some original drawings have corrections. Read the notes on those drawings alongside the worked steps.
Put-call parity and the binomial tree
These are my midterm sheets, going from option relationships to the VBA routines that calculate them. I’ll spell out what each calculation is doing beside the handwritten version, including the corrections needed before using the code.

For European options on a non-dividend-paying stock, with the same strike K and maturity T, put-call parity is $C+Ke^{-rT}=P+S_0$. Both sides deliver the same terminal payoff, so their prices must agree in this frictionless model.
The tree gets the option price by the same no-arbitrage idea. Make a stock-and-option portfolio pay the same amount in the up and down states, then discount that certain payment. Equivalently, use the risk-neutral weight
$$p=\frac{e^{r\Delta t}-d}{u-d},\qquad C=e^{-r\Delta t}[pC_u+(1-p)C_d].$$This requires $d\lt e^{r\Delta t}\lt u$ for an interior probability. Work backwards one step at a time. And a notation trap: $u=e^{\sigma\sqrt{\Delta t}}$ is already a gross multiplier. The terminal payoff is $\max(S_0u^jd^{n-j}-K,0)$, not a formula with $(1+u)^j$.
From random stock movements to Black-Scholes

The stock equation is $dS=\mu S\,dt+\sigma S\,dW$. Over one interval, $\Delta W=Z\sqrt{\Delta t}$ with $Z\sim N(0,1)$. Its variance is $\Delta t$; its standard deviation is $\sqrt{\Delta t}$.
Under this model, log returns are Normal: $\ln(S_{t+\Delta t}/S_t)$ has mean $(\mu-\sigma^2/2)\Delta t$ and variance $\sigma^2\Delta t$. Gross returns are lognormal. The sheet’s Normal-return wording needs that distinction; simple percentage returns are only approximately Normal over a small step.
The Black-Scholes pricing argument eliminates the uncertain stock movement with a hedge. That’s why the non-dividend pricing formula uses the risk-free rate r, rather than the stock’s expected return $\mu$. The continuous trading, frictionless market and constant-parameter assumptions on this sheet are doing real work here.
Flowcharts and VBA building blocks

Read the flowchart in execution order: initialize the variables, perform the update, test the condition, and follow the appropriate arrow. For the call example, the terminal payoff is $\max(S_T-K,0)$; profit after paying the premium is that payoff minus the premium, ignoring its financing cost. With the sheet’s strike 20,000, stock price 21,000 and premium 2,000, exercise pays 1,000 but the overall profit is −1,000. Exercising and making a profit are different questions.

The diagrams include the premium, so they show profit/loss, not just terminal payoff. Reversing a long position reverses its profit diagram. In the code below, stock prices and calculated values belong in floating-point variables such as Double; a loop counter has a different job. The Date limits in the handwritten type table need the correction at the end of this post.

Select Case chooses a branch from a value; Do...Loop repeats a block while its condition permits it. Trace the first pass and the last pass by hand — especially whether a condition is tested before or after an update. Exit Do is another way out, so it must be checked separately from the loop’s main condition.

MsgBox displays a result, InputBox collects input, and Application.WorksheetFunction.Max lets VBA use the worksheet’s maximum function. For Boolean values, And needs both conditions, Or needs at least one, and Xor needs different truth values. In the Imp table, read rows as Y and columns as X: X Imp Y is false only for X true and Y false.

A declaration inside a procedure is local; a declaration at module level has module scope, while Public makes it available more broadly. Set assigns an object reference, for example Set ws = Worksheets("Sheet1"). It is not needed for assigning an ordinary number.
The Greeks underneath ask how the option value responds to each input. Delta is the stock-price derivative, gamma is its second derivative, and vega is the volatility derivative. The put-delta correction matters: it is $-e^{-qT}\Phi(-d_1)$, where q here is the continuous dividend yield. The non-dividend example has q = 0. The final printed table supplies the theta formula my handwritten sheet waves goodbye to.
Turn the tree into code

At maturity, calculate intrinsic values with Max. At each earlier node, take the weighted next-step values and multiply by df = Exp(-r * dt). Here dt = T / n, so one period needs n = 1 and two periods need n = 2. The copied n = 5 does not describe either routine’s full one-year horizon. Use the defined names up and dn consistently; the two-period picture slips into u and d.

For an American option, compare the discounted continuation value with exercise value at each exercise date. In symbols, $V=\max(\text{continuation},\text{intrinsic value})$. For this non-dividend-paying call with a nonnegative interest rate, early exercise adds no value, so the American and European prices should agree. That is a useful check on these particular routines.

The worksheet version does the same backward calculation with cells instead of separate node variables. Fill the terminal column first, then move left so that both child values already exist when you use them. In the sheet’s five-step example, $S_0=K=100$, $u=1.1$, $d=1/u$ and $r=0.05$ give a European call value of about 11.3266. This uses those supplied step multipliers, not a newly inferred volatility.

The added Max tests early exercise at an intermediate node. The pictured root branch only uses continuation; that is harmless for this non-dividend call under the stated conditions, but a general American-option routine must also consider exercise at the root. When copying worksheet code, use Cells and Worksheets, not singular Cell or Worksheet.
Normal probabilities and simulated paths

The CDF goes from a value to a probability; its inverse goes back from a probability to a value. For an actual cumulative call, write WorksheetFunction.NormDist(10, 36, 21, True). The picture omits that required fourth argument. It returns about 0.1078. The standard-normal inverse at 0.94 is 1.55477359, with a small digit error in the sheet.

Generate a standard Normal shock and multiply it by $\sqrt{\Delta t}$ before adding it to W. At T = 1 the theoretical terminal mean is zero and variance is one, however many time steps we choose. Days = 300 here is a numerical grid choice, not a claim that a year has 300 calendar days.

The direct step is $S_{t+\Delta t}\approx S_t+\mu S_t\Delta t+\sigma S_t Z\sqrt{\Delta t}$. It is an approximation to the stock equation. A large negative shock can even make this discretization negative, despite the continuous GBM model staying positive.

The exponential version uses $S_{t+\Delta t}=S_t\exp[(\mu-\sigma^2/2)\Delta t+\sigma Z\sqrt{\Delta t}]$. With constant parameters this gives the exact GBM transition and stays positive. The $-\sigma^2/2$ term is needed; it isn’t an optional adjustment. For the sheet’s $S_0=2$, $\mu=0.2$, T = 1, the theoretical mean terminal price is $2e^{0.2}\approx2.4428$.

For a terminal-only calculation, draw the whole interval’s log return directly rather than storing 300 intermediate points. Average many independent simulated terminal prices. With the pictured drift r = 0.15, $S_0=100$ and T = 1, that mean should fluctuate around $100e^{0.15}\approx116.1834$. A simulated sample won’t hit it exactly. In both Monte Carlo routines, draw a uniform value strictly above zero before using NormSInv; Rnd can return zero.

Now average payoffs, not stock prices: $e^{-rT}\operatorname{mean}[\max(S_T-K,0)]$. For risk-neutral pricing of this non-dividend option, simulate with drift r. Using an investor’s expected return in that position would answer a different question. The discount factor belongs outside the mean, exactly as in the picture.
Before copying the code: When copying the Monte Carlo call function, keep its supplied starting price, volatility, maturity and trial count instead of resetting them to the demonstration values. Initialize the running sum for each call, and reject a zero uniform draw before NormSInv. Initialize Randomize once in the caller; see the corrected executable examples in Monte Carlo #9 .
Check the formula and measure volatility

The parentheses around the denominator of d1 are essential:
d1 = (Log(S / K) + (r + 0.5 * v * v) * T) / (v * Sqr(T))
d2 = d1 - v * Sqr(T)
For the pictured $S=800$, $K=850$, $r=0.05$, T = 0.5 and v = 0.2, this gives $d_1\approx-0.181193$, call ≈ 32.8552 and put ≈ 61.8686. Check parity too: call minus put is about −29.0134, equal to $S-Ke^{-rT}$. Dividing by v and then multiplying by Sqr(T) is a different operation and produces the wrong prices.

Eleven prices give ten log returns, $\ln(S_i/S_{i-1})$. Take their sample standard deviation, then annualize using the observation frequency. Multiplication by $\sqrt{52}$ assumes weekly returns; it is not the right multiplier for a daily series. We need all eleven observations to calculate the sample volatility, not just the first and last prices shown here.

This is the same European, non-dividend formula again, using remaining time $T-t$. Keep the time unit consistent: annual r and volatility need time measured in years.
In this original call picture, the first term of calendar-time theta needs a minus sign. The derivative labels in these two pictures use T ambiguously: use the time-remaining versus calendar-time distinction below.
For either option value $V$, the derivative labels mean $\Delta=\partial V/\partial S$, $\Gamma=\partial^2V/\partial S^2$, vega $=\partial V/\partial\sigma$, and $\rho=\partial V/\partial r$, with the other inputs held fixed. Be careful with theta: calendar-time decay is $\Theta=\partial V/\partial t=-\partial V/\partial\tau$ when $\tau=T-t$ is time remaining and maturity $T$ is fixed. A derivative with respect to time remaining has the opposite sign.

In this table, $\Phi$ is the Normal CDF and $\phi$ is its density. Gamma and vega are shared by calls and puts with matching terms in this model. Vega and rho are derivatives per unit change in volatility or rate; multiply by 0.01 for a one-percentage-point change. The table’s q denotes dividend yield, so set q = 0 when comparing it with the non-dividend routines above.
Image sources:
- anthony-vba.kefra.com/vba/vba13.htm
- Erdem Tokmakoglu — Option Gamma & Dynamic Delta Hedging (SlideShare)
For the required cumulative argument, see Microsoft’s NormDist reference .
Heads-up. The figures here are the original notes, slips and all. A few things to watch for:
- In the table of VBA data types, the Date range is January 1, 100 to December 31, 9999, not 1990/01/01 to 9999/12/30.
- In the operator notes, read the Imp truth table with the rows as Y and the columns as X: X Imp Y is false only when X is true and Y is false.
- In the Greeks table, the put delta is $-e^{-q\tau}\Phi(-d_1)$, not $-e^{-q\tau}\Phi(d_1)$.
- In the two binomial routines, $t = 1$ with $n = 5$ makes each step 0.2 years; for one and two periods to maturity, $n$ should be 1 and 2. The two-period routine also writes u and d where its variables are named up and dn.
- In the Black-Scholes code, the denominator of d1 needs parentheses: d1 = (Log(S / K) + (r + 0.5 * v * v) * T) / (v * Sqr(T)). Written as / v * Sqr(T), VBA divides by v and then multiplies by Sqr(T), so d1 comes out multiplied by T and the call price is off (32.67 instead of about 32.86).
- In the binomial payoff, $u=e^{\sigma\sqrt{\Delta t}}$ is already a gross multiplier: use $u^j$, not $(1+u)^j$. Normality and time-additive mean/variance refer to log returns; gross returns under GBM are lognormal.
- When copying the VBA, use
Cells(...)andWorksheets("sheet name"), not the singular forms. Also, $N^{-1}(0.94)=1.55477359$, and annualizing with $\sqrt{52}$ assumes weekly observations. - In the Normal-distribution sheet, the cumulative NormDist examples need a fourth argument:
WorksheetFunction.NormDist(10, 36, 21, True). The three-argument form omits a required Boolean parameter.



Questions or corrections?
Did a step lose you, or does a number look off? Email me or use the contact page. Include the note title and the step or figure you mean.
Feedback goes to me privately by email; it is not posted as a public comment.