◆Financial Derivatives — In Progress Please await announcements of new courses and upcoming batches. Course Updates →
The Mountain Path Academy
Fixed Income Securities · Excel Workbook Guide

Mastering Bond Mathematics through Excel

Prices, Yields, Accrued Interest, Duration & Convexity — built cell by cell

Coupon · Zero · Floating-rate · Convertible bonds · T-bills, T-notes & T-bonds

Download the Excel Workbook (.xlsx) · 8 sheets

The Mountain Path Academy
Finance · Risk Management · Quantitative Analytics
19 Learning Sections
Live formulas · 9 charts · 4 interactive graphs · Calculator · 10 practice questions

1 How this workbook guide works

Bond mathematics is easier to understand once you have built it yourself in a spreadsheet. Each section below matches one sheet of the companion Excel workbook. Every sheet follows the same steps: inputs → cash flows → present value → yield → sensitivity.

Inputsyellow cells
→
Cash flowscoupon + face
→
PricePV · PRICE
→
YieldRATE · YIELD
→
Riskduration · convexity
SheetWhat you buildKey Excel functions
1 Coupon BondPrice three ways, price–yield curvePV PRICE RATE
2 Zero CouponPrice, yield, pull to parPV RATE
3 FRNQuoted vs discount margin, rate-shock testPV
4 ConvertibleFloor, conversion value, premiums, paybackPV MAX
5 YTM YTC YTWYield to maturity, to each call, to worstYIELD MIN
6 Money MarketT-bills, T-notes, T-bonds and 32ndsTBILLPRICE TBILLEQ DOLLARDE
7 Accrued InterestCoupon calendar, clean vs dirty priceCOUPDAYBS ACCRINT
8 Duration ConvexityMacaulay, modified, convexity, short-cut formulasDURATION MDURATION
How to read the sheet tables

Each Excel panel shows the cell, what it holds, its value and the formula in it. Blue on yellow cells are inputs and green bold cells are key outputs. Prices are per 100 of face value unless a section says otherwise, and every bond here is a hypothetical teaching example.

2 Notation and Excel conventions

SymbolMeaningIn Excel
FFace (par) valueExcel bond functions assume 100
cAnnual coupon rateType 7% or 0.07, never 7
mCoupon payments per yearfrequency: 1, 2 or 4
n = mTNumber of coupon periodsnper in PV and RATE
yYield to maturity (annual, nominal)yld; per period it is y/m
basisDay-count convention0 = 30/360 · 1 = Actual/Actual · 2 = Act/360 · 3 = Act/365

The core equation behind every sheet: price equals the present value of the promised cash flows.

P = Σt=1…n (F·c/m) / (1 + y/m)t + F / (1 + y/m)n
Sign convention in PV and RATE

Excel treats money paid out as negative. =PV(rate,nper,pmt,fv) returns a negative number when the coupon and face are positive, so write =-PV(…). With RATE, enter the price as negative: =RATE(n, C, -P, F).

3 Sheet 1: Pricing a coupon bond three ways

Start with a 10-year, 7% semiannual bond priced at a 7.50% yield. Rebuilding the price three different ways shows that each Excel method computes the same thing.

Sheet 1 · Coupon BondExcel
CellItemValueExcel formula
B5Face value100.00input
B6Coupon rate7.00%input
B7Payments per year2input
B8Years to maturity10input
B9Yield to maturity7.50%input
B10Settlement15-Nov-2026input
B11Maturity15-Nov-2036input
B14Coupon per period3.5000=B5*B6/B7
B15Periods n20=B7*B8
B16Periodic yield3.7500%=B9/B7
B17① Sum of PVs96.5259=SUM(I6:I65)
B18② PV function96.5259=-PV(B16,B15,B14,B5)
B19③ PRICE function96.5259=PRICE(B10,B11,B6,B9,100,B7,0)*B5/100
B21Current yield7.2519%=B5*B6/B18
B22YTM back from price7.5000%=B7*RATE(B15,B14,-B18,B5)
Cash-flow table, row 6: G6 =IF(E6<=$B$15,$B$14+IF(E6=$B$15,$B$5,0),0) · H6 =1/(1+$B$16)^E6 · I6 =G6*H6, copied down to row 65.

① The cash-flow table: the method that shows every step

Put one row for each half-year: period, cash flow (3.50 coupon, and 103.50 in period 20), discount factor and present value. Adding up the PV column gives 96.5259. This is the slowest method, but it shows every step, and you will reuse the same table for duration and convexity on Sheet 8.

② PV: one line, valid only on a coupon date

=-PV(3.75%,20,3.5,100) treats the coupons as an annuity and the face value as a lump sum. It needs a whole number of periods, so it only works when settlement falls on a coupon date.

③ PRICE: real dates, between coupon dates

PRICE(settlement, maturity, rate, yld, redemption, frequency, basis) works from actual dates and returns the clean price per 100. On a coupon date all three methods agree, as the sheet shows. Between coupon dates only PRICE is still correct (see Sheet 7).

Worked example: why is it below par?

The coupon (7.00%) is lower than the yield investors require (7.50%), so the bond sells at a discount: 96.53. The yields line up as coupon rate 7.00% < current yield 7.25% < YTM 7.50%. That ordering holds for every discount bond, and it reverses for a premium bond.

2550751001251501752002%4%6%8%10%12%14%Yield to maturityPrice per 100 face7.50% → 96.53par = 100
0% coupon7% coupon12% coupon
Figure 1. Price–yield curves of three 10-year semiannual bonds (Sheet 1, columns K:N). The curves are convex, and the zero-coupon bond is the most sensitive to yield. The 7% bond trades at par when its yield is 7%.
Try it in the workbook

Change B9 to 7.00%: all three prices become exactly 100.0000 (par). Change it to 6.00%: the bond moves to a premium of 107.4387.

4 Sheet 2: Zero-coupon bonds

A zero-coupon bond has only one cash flow, the face value at maturity. Its price is a single discount factor, and its Macaulay duration equals its maturity. Treasury bills, STRIPS and deep-discount bonds are all priced this way.

P = F / (1 + y/m)m·T   ⇔   y = m · [(F / P)1/(m·T) − 1]
Sheet 2 · Zero CouponExcel
CellItemValueExcel formula
B5Face value100.00input
B6Years to maturity5input
B7Yield7.00%input
B8Compounding per year2input
B9Observed price72.00input
B12Price — formula70.8919=B5/(1+B7/B8)^(B8*B6)
B13Price — PV70.8919=-PV(B7/B8,B8*B6,0,B5)
B15Yield from 72.00 — formula6.6792%=B8*((B5/B9)^(1/(B8*B6))-1)
B16Yield — RATE6.6792%=B8*RATE(B8*B6,0,-B9,B5)
B17Price, annual compounding71.2986=B5/(1+B7)^B6
B19Modified duration4.8309=B6/(1+B7/B8)
Worked example

A 5-year zero at 7% (semiannual compounding) costs 70.89 per 100. If the market price is 72.00 instead, the implied yield is 6.68%. Compounding matters: with annual compounding the price is 71.30, because the same 7% then compounds less often.

7080901005 yrs4 yrs3 yrs2 yrs1 yrs0 yrsYears remaining to maturityPrice per 10070.8975.9481.3587.1493.35100.00
Figure 2. Pull to par for a 5-year zero at a constant 7% yield (Sheet 2, columns E:G). The yearly increase in price is the investor’s entire return, so the bond accretes faster as it gets closer to maturity.

5 Sheet 3: Floating-rate notes (FRNs)

An FRN pays reference rate + quoted margin (QM). The reference rate is a benchmark such as a 3-month T-bill rate, MIBOR or SOFR, and the coupon is reset each period. The coupon follows the market, so the price stays close to par. Two margins matter, and confusing them is the most common mistake:

MarginSet byUsed for
Quoted margin (QM)The bond contract, fixed at issueThe coupon: (ref + QM)/m × F
Discount (required) margin (DM)The market today, based on credit and liquidityThe discount rate: (ref + DM)/m
Sheet 3 · FRNExcel
CellItemValueExcel formula
B6Reference rate6.00%input
B7Quoted margin0.80%input
B8Discount margin1.00%input
B9Resets per year4input
B10Years3input
B13Coupon per period1.7000=(B6+B7)/B9*B5
B14Discount rate per period1.7500%=(B6+B8)/B9
B16FRN price99.4630=-PV(B14,B15,B13,B5)
B17Price if DM = QM100.0000=-PV((B6+B7)/B9,B15,B13,B5)
Simplification used in the curriculum: the reference rate is held flat at today’s level for all future periods.
Worked example

The issuer’s credit has weakened, so investors now want 1.00% over the reference rate while the note pays only 0.80%. The 0.20% shortfall each year, discounted over 3 years, is about 0.54, so the price is 99.46. If DM = QM the note is worth exactly 100.00 on a reset date. DM > QM gives a discount and DM < QM gives a premium, just as YTM against coupon does for a fixed bond.

9497100103106-200 bp-100 bp0+100 bp+200 bpParallel shift in market ratesPrice per 100Fixed 105.56Fixed 94.78FRN 99.51
3-year fixed 6.80%FRN (ref + 0.80%)
Figure 3. A ±200 bp rate shock (Sheet 3, columns I:K). The 3-year fixed bond moves between 94.78 and 105.56. The FRN, one quarter before its next reset, moves only between 99.51 and 100.49, because its coupon resets to the market rate.

Hull’s approach: valuing the FRN as a swap leg

John Hull (Options, Futures and Other Derivatives, interest rate swaps chapter) values a floating-rate bond with one argument. If the coupon resets to the market rate and you discount on that same curve, with no credit spread, the bond is worth exactly par immediately after every reset. Between resets only the next coupon k* is already fixed, and everything after it is worth par at the next payment date. So you discount just one cash flow:

Bfl = (L + k*) · e−r*·t*

Here L is the notional, k* the floating payment fixed at the last reset, t* the time to the next payment and r* the continuously compounded zero rate for t*.

Hull workbook · Sheet 1 Hull FRNExcel
CellItemValueExcel formula
B5Notional L ($ m)100.00input
B66-month rate set at last reset10.20%input
B8Time to next payment t*0.25input
B9Zero rate r* (continuous)10.00%input
B12Next payment k*5.1000=B5*B6/B7
B13Value at next payment L + k*105.1000=B5+B12
B14Discount factor0.975310=EXP(-B9*B8)
B15Floating-rate bond B_fl102.5051=B13*B14
K10Full check: every coupon projected from forwards102.5051=SUM(K6:K8)
The full check projects each floating coupon from forward rates and discounts all of them. The answer is identical, because each future coupon plus the par it sits on is worth par one period earlier.
Worked example: Hull’s swap valuation

A swap receives 8% fixed (semiannual) and pays 6-month LIBOR on $100 m, with 1.25 years left. The zero rates are 10%, 10.5% and 11% for 0.25, 0.75 and 1.25 years.

Fixed leg: Bfix = 4e−0.10×0.25 + 4e−0.105×0.75 + 104e−0.11×1.25 = 98.24. Floating leg: Bfl = 105.1e−0.10×0.25 = 102.51.

Swap value to the receive-fixed party = 98.24 − 102.51 = −$4.27 m. Valuing the swap as a portfolio of FRAs gives the same figure, as Sheet 2 of the Hull workbook shows.

AspectHullCFA-style margin approach (above)
Main useFloating leg of an interest rate swapPricing a credit-risky FRN
Credit spreadNone: same curve for coupon and discountingQuoted margin vs discount margin
Price on a reset dateExactly parPar only if DM = QM
Cash flows modelledOne: (L + k*) at the next resetAll coupons, reference rate held flat
CompoundingContinuousPeriodic (rate/m)
Duration≈ time to next resetDriven by the DM–QM gap and maturity

Figure 3 above already uses Hull’s logic: the FRN is priced as (face + next coupon) discounted to the next reset, which is why it barely moves when rates shift.

Download the Hull FRN & Swap Valuation workbook (.xlsx)

6 Sheet 4: Convertible bonds

A convertible bond lets the holder swap the bond for a fixed number of shares (the conversion ratio). When the share price is low it behaves like a bond, and when the share price is high it behaves like the stock. In Excel, value it from two sides and take the higher.

Sheet 4 · Convertible (per ₹1,000 bond)Excel
CellItemValueExcel formula
B6Coupon (annual)6.00%input
B7Years5input
B8Straight-bond yield9.00%input
B9Conversion ratio25input
B10Share price₹32.00input
B11Market price of CB₹1,020.00input
B12Dividend per share₹1.00input
B15Straight value (floor)883.31=-PV(B8,B7,B5*B6,B5)
B16Conversion price40.00=B5/B9
B17Conversion value800.00=B9*B10
B18Minimum value883.31=MAX(B15,B17)
B19Market conversion price40.80=B11/B9
B20Conversion premium per share8.80=B19-B10
B21Conversion premium ratio27.50%=B20/B10
B22Premium over straight value15.47%=B11/B15-1
B23Favourable income difference35.00=B5*B6-B9*B12
B24Premium payback (years)6.29=(B11-B17)/B23
Reading the numbers

Converting today would give 25 × ₹32 = ₹800. Holding the bond is worth ₹883.31. The market pays ₹1,020, which is 27.50% above conversion parity, because the share could still rise. Each year the bond pays ₹35 more than the dividends on 25 shares would, so the premium over conversion value is earned back in about 6.3 years.

05001,0001,5002,000₹0₹10₹20₹30₹40₹50₹60₹70₹80Share priceValue per ₹1,000 bondMarket price ₹1,020 at S = ₹32Straight-value floor ₹883.31Kink at S = ₹35.33
Straight valueConversion valueMinimum valueMarket value (illustrative)
Figure 4. The minimum value is the higher of the straight value (floor) and the conversion value (Sheet 4, columns E:H). The market price sits above that minimum because the conversion option has time value. The dotted gold curve is drawn for illustration and is not computed in the workbook.

7 Sheet 5 (part 1): Yield to maturity with RATE, YIELD and Goal Seek

Yield to maturity (YTM) is the single discount rate that makes the PV of the promised cash flows equal to the price, which is the bond’s internal rate of return. There is no closed-form formula, so Excel solves for it by iteration. Three ways to get it:

MethodFormulaWhen to use
RATE=m*RATE(n, C, -P, F)Settlement on a coupon date
YIELD=YIELD(settle, mat, c, P, 100, m, basis)Any settlement date, using the clean price
Goal SeekData → What-If → Goal Seek: set the price cell to the market price by changing the yield cellAny model you have built yourself
Sheet 5 · Callable bond inputs and YTMExcel
CellItemValueExcel formula
B5Settlement15-Nov-2026input
B6Maturity15-Nov-2036input
B7Coupon8.00%input
B8Clean price104.50input
B13YTM — YIELD7.3565%=YIELD(B5,B6,B7,B8,100,B9,B10)
B14YTM — RATE check7.3565%=B9*RATE(COUPNUM(B5,B6,B9,B10),100*B7/B9,-B8,100)
B15Current yield7.6555%=100*B7/B8
YTM rests on three assumptions

The bond is held to maturity, every coupon and principal payment is made, and every coupon is reinvested at the YTM. If any of these fails, the return you actually earn will differ from the YTM.

8 Sheet 5 (part 2): Yield to call and yield to worst

A callable bond can be redeemed early by the issuer, at a set call price, on set dates. Yield to call (YTC) uses the same YIELD function with two changes: maturity = call date and redemption = call price. Yield to worst (YTW) is the lowest of the YTM and every YTC. It is the yield you can count on whatever the issuer decides.

Sheet 5 · Call schedule (E6:H9)Excel
CellItemValueExcel formula
G6YTC to 15-Nov-2029 @ 1026.9243%=YIELD($B$5,E6,$B$7,$B$8,F6,$B$9,$B$10)
G7YTC to 15-Nov-2031 @ 1017.0856%=YIELD($B$5,E7,$B$7,$B$8,F7,$B$9,$B$10)
G8YTC to 15-Nov-2033 @ 1007.1711%=YIELD($B$5,E8,$B$7,$B$8,F8,$B$9,$B$10)
G9YTM to 15-Nov-2036 @ 1007.3565%=B13
B16Yield to worst6.9243%=MIN(B13,G6:G8)
B17Worst-case date15-Nov-2029=INDEX(E6:E9,MATCH(B16,G6:G9,0))
Why the earliest call is the worst case here

At 104.50 the bond trades well above its call prices. If it is called in 2029, the holder loses the premium (104.50 down to 102) over just 3 years instead of 10, so the yield falls to 6.92% from a YTM of 7.36%. For a bond trading at a discount, an early call works in the investor’s favour, and the YTM is usually the worst case. Quote the YTW, which is the convention for callable bonds.

6.6%6.8%7.0%7.2%7.4%Redemption scenarioYield6.924%Call 2029 @1027.086%Call 2031 @1017.171%Call 2033 @1007.356%Maturity 2036
Figure 5. The four yields from Sheet 5. For a premium bond, the earliest call gives the lowest yield, so that call is the yield to worst (maroon bar).
Putable bonds

The same template works for a putable bond, which the investor can sell back early. Put dates help the holder, so compare yield-to-put with YTM and expect the put to matter when rates have risen.

9 Sheet 6 (part 1): Money-market instruments and T-bills

Money-market instruments (T-bills, commercial paper, certificates of deposit) mature in a year or less and are usually issued at a discount. They pay no coupon, and the return is the difference between the purchase price and face value. The maths is simple. What trips people up is the different yield quotation conventions.

Indian T-bills: yield on price, 365-day year

P = 100 / (1 + y · d/365)   ⇔   y = (100 − P)/P × 365/d
TenorYield (input)Price per ₹100
91-day5.45%98.6594
182-day5.55%97.3071
364-day5.65%94.6660
Worked example: auction cut-off

A 91-day T-bill is allotted at ₹98.65. Yield = (100 − 98.65)/98.65 × 365/91 = 5.4889%. In the workbook: =(100-B10)/B10*365/91.

US T-bills: discount basis, 360-day year, with dedicated Excel functions

Sheet 6 · US 26-week T-billExcel
CellItemValueExcel formula
B14Settlement15-Nov-2026input
B15Maturity14-May-2027input
B16Bank discount rate3.80%input
B17Days to maturity180=B15-B14
B18Price98.1000=TBILLPRICE(B14,B15,B16)
B19Price — by hand98.1000=100*(1-B16*B17/360)
B20Money-market yield3.8736%=TBILLYIELD(B14,B15,B18)
B21MMY — by hand3.8736%=(100-B18)/B18*360/B17
B22Bond-equivalent yield3.9274%=TBILLEQ(B14,B15,B16)
B23BEY — by hand3.9274%=(100-B18)/B18*365/B17
3.6%3.7%3.8%3.9%4.0%Same 180-day US T-bill, price 98.10Annualised yield3.8000%Discount rate (360, on face)3.8736%Money-market yield (360, on price)3.9274%Bond-equivalent yield (365, on price)
Figure 6. One bill, three yields (Sheet 6, E14:F17). The discount rate understates the return because it divides by face value and uses a 360-day year. Convert to the bond-equivalent yield before comparing a bill with a coupon bond.
Bills longer than 182 days

The simple 365/d bond-equivalent formula applies to bills of up to 182 days. For longer bills the bond-equivalent convention adds a quadratic adjustment so that the yield reflects semiannual compounding, so the simple formula and a calculator may differ slightly. State which convention you are using.

10 Sheet 6 (part 2): T-notes, T-bonds and quotes in 32nds

InstrumentMaturity at issueCash flowsQuoteExcel
T-bill4 to 52 weeksNone (discount)Discount rateTBILLPRICE TBILLEQ
T-note2, 3, 5, 7, 10 yearsSemiannual couponPrice in 32nds, e.g. 98-16DOLLARDE YIELD
T-bond20 and 30 yearsSemiannual couponPrice in 32ndsDOLLARDE YIELD
Indian G-secUp to 50 yearsSemiannual couponPrice per ₹100, two decimalsYIELD with basis 0 (30/360)

US Treasury prices are quoted in 32nds: “98-16” means 98 + 16/32 = 98.50. Excel converts with DOLLARDE. Type the quote as 98.16 and the fraction denominator as 32, and DOLLARFR converts back.

Sheet 6 · 10-year T-note and 30-year T-bondExcel
CellItemValueExcel formula
B29T-note quote 98-16 (typed 98.16)98.16input
B30Clean price98.5000=DOLLARDE(B29,32)
B31Yield (Actual/Actual)4.4405%=YIELD(B26,B27,B28,B30,100,2,1)
B32Accrued interest1.0625=100*B28/2*COUPDAYBS(B26,B27,2,1)/COUPDAYS(B26,B27,2,1)
B33Invoice (dirty) price99.5625=B30+B32
B39T-bond quote 95-08 (typed 95.08)95.08input
B40Clean price95.2500=DOLLARDE(B39,32)
B41Yield4.9306%=YIELD(B36,B37,B38,B40,100,2,1)
B43Invoice (dirty) price96.4062=B40+B42
T-note: 4.25% coupon maturing 15-Aug-2036 · T-bond: 4.625% coupon maturing 15-Aug-2056 · settlement 15-Nov-2026 (hypothetical quotes).
Worked example

The 4.25% T-note at 98-16 yields 4.44%. Settlement falls 92 days into a 184-day coupon period, so the buyer also pays accrued interest of 2.125 × 92/184 = 1.0625, giving an invoice price of 99.5625. US Treasuries use Actual/Actual (basis 1); Indian G-secs and most corporate bonds use 30/360 (basis 0).

11 Sheet 7: Accrued interest, clean price and dirty price

Bonds change hands between coupon dates. The seller has earned interest for part of the current period, so the buyer pays it on top of the quoted price. That gives three related numbers:

Accrued interest = (c/m) × F × A/E   ·   Dirty (full, invoice) price = Clean (quoted) price + Accrued interest

where A is the number of days from the last coupon to settlement and E is the number of days in the coupon period, both under the bond’s day-count basis. Excel’s coupon-calendar functions give you every piece:

Sheet 7 · 7% bond maturing 15-Aug-2036, settled 15-Nov-2026, YTM 7.50%, 30/360Excel
CellItemValueExcel formula
B13Previous coupon15-Aug-2026=COUPPCD(B5,B6,B9,B10)
B14Next coupon15-Feb-2027=COUPNCD(B5,B6,B9,B10)
B15Days accrued A90=COUPDAYBS(B5,B6,B9,B10)
B16Days in period E180=COUPDAYS(B5,B6,B9,B10)
B17Days to next coupon90=COUPDAYSNC(B5,B6,B9,B10)
B18Coupons remaining20=COUPNUM(B5,B6,B9,B10)
B21Accrued interest1.7500=100*B7/B9*B15/B16
B22Accrued — ACCRINT1.7500=ACCRINT(B13,B14,B5,B7,100,B9,B10)
B23Clean price96.5692=PRICE(B5,B6,B7,B8,100,B9,B10)
B24Dirty price98.3192=B23+B21
B25Dirty — PV of cash flows98.3192=SUM(H29:H48)
Check table, rows 29–48: each cash flow is discounted for (k − 1 + w) periods, where w = days to next coupon ÷ days in period = 0.5. The total matches PRICE + accrued interest exactly.
Worked example

From 15 Aug to 15 Nov is 90 days on a 30/360 basis, out of a 180-day period. Accrued interest = 3.50 × 90/180 = 1.75. PRICE gives a clean price of 96.5692, so the buyer pays a dirty price of 98.3192 per 100. On ₹10 crore face value that is ₹9.8319 crore.

96979899100Aug 26Nov 26Feb 27May 27Aug 27Nov 27Feb 28Settlement date (yield held at 7.50%)Price per 10015-Nov-26: dirty 98.3192clean ≈ 96.5–96.9, drifting towards par
Clean (quoted) priceDirty (invoice) price
Figure 7. Clean and dirty prices across settlement dates 5 days apart (Sheet 7, rows 52–161). Accrued interest builds up through each coupon period and drops to zero on the coupon date (dashed lines). Bond prices are quoted clean so that the quote does not jump each time a coupon is paid.
Day count changes the answer

The same bond settled on the same date accrues differently under each basis. On 30/360 every month has 30 days; on Actual/Actual (US Treasuries) the period here has 184 actual days. Always set basis to match the market the bond trades in.

12 Sheet 8 (part 1): Macaulay duration

Macaulay duration is the PV-weighted average time to receive the bond’s cash flows, measured in years. Each period’s weight is its share of the total price.

MacD = [ Σ t × PV(CFt) / P ] ÷ m
Period tTimeCash flowPV @ 3.75%Weightt × PV
10.53.50003.37353.49%3.3735
21.03.50003.25163.37%6.5031
31.53.50003.13403.25%9.4021
………………
199.53.50001.73901.80%33.0406
2010.0103.500049.565451.35%991.3071
Σ96.5259100.00%1,409.4681
Sheet 8 · DurationExcel
CellItemValueExcel formula
B16Macaulay duration (table)7.3010=SUM(J6:J65)/B15/B7
B22Macaulay duration (DURATION)7.3010=DURATION(B10,B11,B6,B9,B7,0)
Worked example

Σ t × PV = 1,409.4681 (in half-years). Divide by the price of 96.5259: 14.6020 half-years, which is 7.3010 years. Excel’s DURATION function returns the same figure.

010203040500 yr2 yr4 yr6 yr8 yr10 yrTime of cash flow (years)PV of cash flow49.57Macaulay duration = 7.3010 yearscoupons: 3.37 → 1.68
Figure 8. Macaulay duration as a balance point. The bars are the PVs of the 20 cash flows (Sheet 8, column H), and the beam balances at 7.30 years. The large final payment (49.57) pulls the balance point towards maturity, but the coupons keep it below 10 years.
What drives duration

Duration is longer for a longer maturity, a lower coupon or a lower yield. A zero-coupon bond’s duration equals its maturity, and a coupon bond’s is always shorter. An FRN’s duration is roughly the time to its next reset.

13 Sheet 8 (part 2): Modified duration and DV01

Macaulay duration is measured in time. Modified duration converts it into price sensitivity: the approximate percentage change in price for a 1-percentage-point (100 bp) change in yield.

ModD = MacD / (1 + y/m)   ·   %ΔP ≈ −ModD × Δy   ·   DV01 = ModD × P × 0.0001
Sheet 8 · Modified duration and DV01Excel
CellItemValueExcel formula
B17Modified duration7.0371=B16/(1+B9/B7)
B23Modified duration — MDURATION7.0371=MDURATION(B10,B11,B6,B9,B7,0)
B19DV01 per 100 face0.067926=B17*B15*0.0001
Worked example

ModD = 7.3010 / 1.0375 = 7.0371. If the yield rises by 100 bp, the price should fall by about 7.04%. The DV01 is 0.0679 per 100 face, so a ₹100 crore position loses about ₹6.79 lakh for each basis point the yield rises.

14 Sheet 8 (part 3): Convexity and the short-cut formulas

The price–yield curve is convex, so duration alone underestimates price gains and overestimates price losses. Convexity measures the curvature. Excel has no CONVEXITY function, so build it from the cash-flow table:

Convexity = Σ t(t+1) × PV(CFt) / [ P × (1 + y/m)2 × m2 ]

Short-cut (effective) formulas: three prices and no cash-flow table

Reprice the bond at y − Δy (V−), at y (V0) and at y + Δy (V+). With these three prices you can approximate duration and convexity for any bond you can price, which is how analysts do it for callable bonds, MBS and portfolios.

Approx. duration = (V− − V+) / (2 × V0 × Δy)   ·   Approx. convexity = (V− + V+ − 2V0) / (V0 × Δy2)
Sheet 8 · Convexity and short-cut, Δy = 0.25%Excel
CellItemValueExcel formula
B18Convexity (table)63.3632=SUM(K6:K65)/(1+B9/B7)^2/B15/B7^2
B27V− at 7.25%98.2434=-PV((B9-B12)/B7,B7*B8,B5*B6/B7,B5)
B28V0 at 7.50%96.5259=-PV(B9/B7,B7*B8,B5*B6/B7,B5)
B29V+ at 7.75%94.8467=-PV((B9+B12)/B7,B7*B8,B5*B6/B7,B5)
B30Approx. duration7.0377=(B27-B29)/(2*B28*B12)
B31Approx. convexity63.3668=(B27+B29-2*B28)/(B28*B12^2)
Worked example: predict a +100 bp shock

Approx. duration = (98.2434 − 94.8467) / (2 × 96.5259 × 0.0025) = 7.0377, almost identical to MDURATION. Approx. convexity = (98.2434 + 94.8467 − 2 × 96.5259) / (96.5259 × 0.0025²) = 63.37.

Duration effect = −7.0377 × 1% = -7.0377%. Convexity effect = ½ × 63.37 × (1%)² = +0.3168%. Total = -6.7209%, giving an estimated price of 90.0385 against an exact repriced value of 90.0292. The error is only 0.0093.

ΔyExact priceDuration onlyDuration + convexityError of D + C
-300 bp119.95116.91119.66-0.2965
-200 bp111.42110.11111.34-0.0847
-100 bp103.63103.32103.63-0.0098
+0 bp96.5396.5396.53+0.0000
+100 bp90.0389.7390.04+0.0093
+200 bp84.0982.9484.16+0.0761
+300 bp78.6576.1578.90+0.2525
758595105115-300 bp-200 bp-100 bp0+100 bp+200 bp+300 bpChange in yield from 7.50%Price per 100exact 78.65duration only 76.15exact 119.95
Exact priceDuration onlyDuration + convexity
Figure 9. Duration gives a straight tangent line, so it understates the price for both rises and falls in yield. Adding the convexity term bends the estimate back towards the true curve (Sheet 8, columns M:Q).
Choosing Δy

Use a small, symmetric bump: 5 to 25 bp. If it is too large, higher-order curvature distorts the estimate. If it is too small, rounding error in the prices takes over. For an option-free bond the short-cut measures match the analytical ones closely, as the sheet shows. For callable bonds, value V− and V+ with a model that lets the issuer’s call decision change.

15 Interactive lab: the price–yield curve, the duration line and convexity

A bond’s price is a curved function of its yield. Duration replaces that curve with a straight line, the tangent at today’s yield. Convexity measures how much the true curve bends away from that line. This lab makes all three visible: move the yield and watch the gap open up.

MeasureGeometryPrice-change formulaAccuracy
DurationSlope of the tangent line at today’s yield%ΔP ≈ −ModD · ΔyGood for small moves; error grows with Δy²
Duration + convexityTangent plus a parabola that bends with the curve%ΔP ≈ −ModD · Δy + ½ · C · Δy²Very close even for ±200 bp
Exact repricingThe curve itselfP = Σ CF / (1 + y/m)tExact (what Excel PV / PRICE give)
Price vs yield — curve, tangent and convexity correction (hover or tap the chart)
Exact price (curve)Duration line (linear)Duration + convexityConvexity gap
Figure 10. The straight duration line touches the curve only at today’s yield. Everywhere else the curve lies above it, so duration alone overstates losses when yields rise and understates gains when they fall. The shaded gold area is the extra value convexity adds.
Gain vs loss for the same size of move
Figure 11. The price gain when yields fall is larger than the loss when they rise by the same amount. The duration line predicts two equal moves.
Approximation error vs Δy
Figure 12. Estimated minus exact price. The duration-only error grows with the square of the yield change; adding convexity removes most of it.

Which bonds are more convex?

Tick bonds to compare their percentage price changes. Longer maturities and lower coupons make the curve steeper (higher duration) and more bent (higher convexity).

Figure 13. Percentage price change against yield change for each bond, all starting from the same yield. The table beneath gives each bond’s modified duration and convexity, both computed live.
Four things to take from the graphs
  1. Duration is the slope: a linear, first-order estimate, exact only for tiny moves.
  2. Convexity is the curvature: for an option-free bond it is always positive, so the true price is always above the duration line.
  3. Positive convexity is valuable: you gain more when yields fall than you lose when they rise by the same amount.
  4. Convexity rises with maturity and with lower coupons and lower yields. Callable bonds and MBS can show negative convexity near the call price, where the curve bends the other way.
Try it in the workbook

Set the coupon to 0 and maturity to 30 years, then drag Δy to ±400 bp. The duration-only error becomes large, while duration + convexity stays close to the exact price. Then try a 2-year bond: the curve is almost a straight line.

16 Interactive bond calculator: the workbook in your browser

Change any input. The calculator repeats the workbook’s logic for a bond settled on a coupon date: it prices the bond, computes Macaulay duration, modified duration and convexity, runs the short-cut formulas, and compares the estimated price shock with an exact repricing. The Excel formula for the current inputs is printed so you can paste it straight into a cell.

Exact priceDuration onlyDuration + convexity
Price against yield within ±300 bp of your YTM. The dot marks today’s price.

17 Excel function cheat sheet and common mistakes

FunctionSyntaxReturns
PVPV(rate, nper, pmt, [fv])Price on a coupon date (negate it)
RATERATE(nper, pmt, pv, [fv])Periodic yield; multiply by m
PRICEPRICE(settle, mat, rate, yld, redemption, freq, [basis])Clean price per 100
YIELDYIELD(settle, mat, rate, pr, redemption, freq, [basis])YTM, or YTC when given a call date and call price
ACCRINTACCRINT(issue, first_interest, settle, rate, par, freq, [basis])Accrued interest
COUPPCD / COUPNCDCOUPPCD(settle, mat, freq, [basis])Previous / next coupon date
COUPDAYBS / COUPDAYSCOUPDAYBS(settle, mat, freq, [basis])Days accrued / days in the period
DURATION / MDURATIONDURATION(settle, mat, coupon, yld, freq, [basis])Macaulay / modified duration
TBILLPRICETBILLPRICE(settle, mat, discount)T-bill price per 100
TBILLYIELD / TBILLEQTBILLYIELD(settle, mat, pr) · TBILLEQ(settle, mat, discount)Money-market yield / bond-equivalent yield
DOLLARDE / DOLLARFRDOLLARDE(98.16, 32)98.50; DOLLARFR converts back to 32nds
Seven mistakes that cost marks
  1. Typing 7 instead of 7%. Excel then reads the rate as 700%.
  2. Forgetting to divide by m. A semiannual bond needs y/2 and 2T periods in PV and RATE.
  3. Treating PRICE as the cash you pay. PRICE is clean; add accrued interest to get the invoice price.
  4. Using PV between coupon dates. It assumes whole periods, so use PRICE or the fractional-period table instead.
  5. The wrong basis. Indian G-secs and corporates use 30/360 (0); US Treasuries use Actual/Actual (1).
  6. Typing “98-16” as 98.16. Excel then treats it as 98.16 rather than 98.50. Convert with DOLLARDE first.
  7. Quoting YTM on a premium callable bond. The yield to worst is the honest number.

18 Practice exercises (solve in Excel, then check)

Q1. A 5-year, 8% annual-coupon bond yields 6%. What is its price per 100, and what Excel formula gives it?

=-PV(6%,5,8,100) = 108.4247. It trades at a premium because the coupon is higher than the yield.

Q2. A 3-year zero-coupon bond costs 85.00 per 100. What is its yield with semiannual compounding?

=2*RATE(6,0,-85,100) = 5.4913%.

Q3. A 91-day Indian T-bill is allotted at ₹98.70. What is its yield?

(100 − 98.70)/98.70 × 365/91 = 5.2830%.

Q4. A 91-day US T-bill is quoted at a 4.00% discount rate. Find its price and bond-equivalent yield.

Price = 100 × (1 − 0.04 × 91/360) = 98.9889. BEY = 365 × 0.04 / (360 − 0.04 × 91) = 4.0970%. In Excel use TBILLPRICE and TBILLEQ.

Q5. A 6% semiannual bond (30/360) settles 60 days after its last coupon at a clean price of 101.20. What is the dirty price?

Accrued interest = 3 × 60/180 = 1.00, so the dirty price = 101.20 + 1.00 = 102.20.

Q6. A bond has modified duration 6.5 and convexity 55. Estimate the % price change if its yield rises by 100 bp.

−6.5 × 0.01 + ½ × 55 × 0.01² = −6.50% + 0.275% = −6.225%.

Q7. V− = 102.10, V0 = 100.00 and V+ = 97.98 for Δy = 0.50%. Find the approximate duration and convexity.

Duration = (102.10 − 97.98)/(2 × 100 × 0.005) = 4.12. Convexity = (102.10 + 97.98 − 200)/(100 × 0.005²) = 32.0.

Q8. A convertible has a conversion ratio of 20, the share price is ₹55 and the straight value is ₹1,040. What is its minimum value?

Conversion value = 20 × 55 = ₹1,100. Minimum value = MAX(1,040, 1,100) = ₹1,100, so the bond now trades like the equity.

Q9. An FRN pays reference + 1.20% and investors now require reference + 0.90%. Premium or discount?

The quoted margin is higher than the discount margin, so the FRN trades at a premium, because its coupon is more generous than the market now requires.

Q10. Why is yield to worst usually the first call yield for a bond trading well above its call price?

An early call returns only the call price, so the premium paid is lost over a short period. That gives the lowest annualised yield.

19 References and next steps

  1. Microsoft Support — PRICE function
  2. Microsoft Support — YIELD function
  3. Microsoft Support — ACCRINT function
  4. Microsoft Support — COUPDAYBS function and COUPDAYS function
  5. Microsoft Support — DURATION function and MDURATION function
  6. Microsoft Support — TBILLPRICE, TBILLYIELD and TBILLEQ
  7. Microsoft Support — DOLLARDE function
  8. Microsoft Support — Financial functions reference
  9. TreasuryDirect — Treasury bills, notes and bonds
  10. Reserve Bank of India — FAQs on the Government Securities Market
  11. CFA Institute, Fixed Income curriculum readings on bond valuation, yield measures and interest-rate risk (Level I).
  12. John C. Hull, Options, Futures and Other Derivatives (Pearson), chapter on interest rate swaps: valuing a swap in terms of bond prices and as a portfolio of FRAs.
  13. Frank J. Fabozzi, Bond Markets, Analysis, and Strategies (Pearson), chapters on pricing, yield measures, duration and convexity.

Educational content only. All bonds, quotes and yields are hypothetical examples chosen for teaching and are not market data or investment advice. Excel results shown were produced by the companion workbook.