Home › Templates › Bond yield to maturity spreadsheet

Bond Yield to Maturity Spreadsheet

A free yield to maturity calculator for Excel and Google Sheets. Type a bond's settlement date, maturity, coupon and clean price. The sheet returns the yield to maturity with Excel's YIELD function, checks it two independent ways, and adds current yield, yield to call, yield to worst, accrued interest, the full cash-flow schedule, Macaulay and modified duration, convexity and a ±100 bp price test. A comparison tab ranks up to 10 bonds by after-tax and taxable-equivalent yield.

Download Excel template (.xlsx) 143 KB · 8 tabs · no macros · Excel 2016+, Google Sheets, LibreOffice · v1.0, 10 Nov 2026

Use it in Google Sheets: choose File → Import → Upload in Sheets and pick the .xlsx, or upload it to Google Drive and open it with Google Sheets. No sign-up, no email gate, no add-in.

Preview: the Example tab. The bond, its price and the call terms are fictional and are not a quote or a recommendation.
4.563%yield to maturity (YIELD)
4.203%yield to call (15 Aug 2031 at 100) = yield to worst
4.836%current yield
$10,460.83cost for $10,000 face incl. $120.83 accrued
7.61modified duration (7.79 yrs Macaulay)
−7.27%price change if yields rise 100 bp (estimate −7.26%)
Input (yellow cells)ExampleResultExample
Settlement date12 Nov 2026Yield to maturity4.563%
Maturity date15 Aug 2036Yield to call4.203%
Annual coupon5.00%Yield to worst4.203%
Coupons per year2Accrued interest per 1001.208333
Clean price per 100103.40Dirty price per 100104.608333
Day-count basis0 (US 30/360)Modified duration7.614
Call date / call price15 Aug 2031 / 100Convexity70.66
80901001101201301401.56%2.56%3.56%4.56%5.56%6.56%7.56%Exact price (PRICE + accrued)Duration onlyDuration + convexitytoday 104.61 at 4.56%Yield to maturityDirty price per 100

What yield to maturity means

FINRA defines it plainly: "Yield to maturity (YTM) is the overall interest rate earned by an investor who buys a bond at the market price and holds it until maturity. Mathematically, it is the discount rate at which the sum of all future cash flows (from coupons and principal repayment) equals the price of the bond" (FINRA, Bond Yield and Return). In symbols, for a bond with f coupons a year:

clean price + accrued interest = Σ cash flowk ÷ (1 + YTM ÷ f)tk  ·  tk = DSC ÷ E + k − 1

DSC is the number of days from settlement to the next coupon and E the days in the current coupon period. No algebra solves this for YTM, so Excel's YIELD iterates: Microsoft says it runs up to 100 Newton-method iterations on the PRICE formula until the price matches (Microsoft Support, YIELD function).

Three related numbers sit next to YTM in the sheet:

FINRA also lists the assumptions: YTM "assumes that coupon and principal payments are made on time", computations "generally" assume coupons are reinvested at the same rate, and it "does not consider taxes". Its summary: "YTM and YTC are estimates only, and should be treated as such."

What's inside the spreadsheet

TabWhat you typeWhat it calculates
Start hereNothingSteps, formulas in plain words, colour key, limits, sources, disclaimer
SummaryNothingYour bond next to the Example: yields, accrued interest, cost, duration, convexity, DV01, ±change scenarios, best bond on each comparison tab; two price-yield charts
Bond calculatorSettlement and maturity dates, coupon, coupons per year, clean price, optional redemption, day-count basis, face amount, call date and price, target yield, yield changeYTM, current yield, YTC, YTW, coupon dates and day counts, accrued interest, dirty price, cost in $, Macaulay and modified duration, convexity, DV01, exact and estimated price change for a yield move, price at a target yield, built-in DURATION/MDURATION, RATE and cash-flow cross-checks, warnings; 13-point price-yield table
Cash flowsNothingUp to 400 coupon dates: coupon, principal, cash for your face amount, time in periods and years, discount factor, present value, PV × t and PV × t(t+1), plus the sums behind duration and convexity
Bond comparisonSettlement date, federal and state tax rates, up to 10 bonds (type, maturity, coupon, frequency, basis, price, call terms)YTM, current yield, YTC, YTW, accrued interest, Macaulay and modified duration, tax rate on the interest, after-tax yield, taxable-equivalent yield, rank; bar chart
Example, Example cash flows, Example comparisonAlready filled with fictional bondsThe same tabs with every result visible, plus seven published worked examples re-run with live formulas

How to use it

  1. Get the bond's terms from the trade confirmation or your broker's bond page. For municipal bonds, the MSRB's EMMA site "provides real-time trade prices, official statements, credit ratings" and more for "more than one million outstanding municipal securities" (MSRB, About EMMA). Treasury terms are on TreasuryDirect.
  2. On Bond calculator, type the settlement date (the day you pay), the maturity date and the annual coupon as a percentage.
  3. Type the clean price per 100: the quoted price without accrued interest. A quote of 98.75 means $987.50 per $1,000 of face value.
  4. Pick coupons per year (2 for most US bonds) and the day-count basis: 0 = US 30/360 for corporate and municipal bonds, 1 = actual/actual for Treasury notes and bonds.
  5. If the bond is callable, add the first call date and the call price. Add your face amount to see the cost in dollars.
  6. Check that Input check says OK. Read the yields first, then accrued interest and cost, then duration and the scenario lines. The last line shows any warning.
  7. To compare bonds, fill one row per bond on Bond comparison and type your own federal and state tax rates at the top.

The formulas

Excel's syntax is YIELD(settlement, maturity, rate, pr, redemption, frequency, [basis]), where pr is the price per $100 of face value and frequency is 1, 2 or 4. PRICE takes the same arguments with a yield in place of the price (Microsoft Support, PRICE function). Day-count basis:

BasisDay countTypical use
0 or blankUS (NASD) 30/360US corporate and municipal bonds
1Actual/actualUS Treasury notes and bonds
2Actual/360Some money-market and floating-rate paper
3Actual/365Some non-US bonds
4European 30/360Some eurobonds

Exact formulas from the Example tab. In the file, every result is wrapped in IF($C$19, …, "") so it stays blank until the inputs pass the input check; B6 is settlement, B7 maturity, B8 coupon, B9 frequency, B10 clean price, C11 redemption used, C12 basis used, C17 the yield change.

Result (Example tab cell)Formula in the file
Yield to maturity (B22)=IF($B$19="OK",IFERROR(YIELD($B$6,$B$7,$B$8,$B$10,$C$11,$B$9,$C$12),"No yield found: check the price"),"")
Current yield (B23)=$B$8*100/$B$10
Yield to call (B24)=IF(ISNUMBER($B$14),IFERROR(YIELD($B$6,$B$14,$B$8,$B$10,$C$15,$B$9,$C$12),"No yield found"),"Not callable")
Yield to worst (B25)=IF(ISNUMBER($B$24),MIN($B$22,$B$24),$B$22)
Accrued interest per 100 (B33)=100*$B$8/$B$9*$B$30/$B$31
Dirty price (B34)=$B$10+$B$33
Modified duration (B40)=$B$39/(1+$B$22/$B$9)
Dirty price if yield rises (B46)=PRICE($B$6,$B$7,$B$8,$B$22+$C$17,$C$11,$B$9,$C$12)+$B$33
Duration + convexity estimate (B49)=-$B$40*$C$17+0.5*$B$41*$C$17^2
RATE cross-check (B60)=IF(AND($B$30=0,$B$32=$B$31),RATE($B$27,100*$B$8/$B$9,-$B$10,$C$11)*$B$9,"n/a: settlement is between coupon dates")
Price at target yield (B55)=IF(ISNUMBER($B$16),PRICE($B$6,$B$7,$B$8,$B$16,$C$11,$B$9,$C$12),"No target yield")

The Cash flows tab lists every payment and discounts it at the YIELD result. Row 12 formulas:

Result (Example tab cell)Formula in the file
Pay date (B12)=IF($A12="","",IF(EOMONTH(Example!$B$7,0)=Example!$B$7,EOMONTH(Example!$B$7,-($B$4-$A12)*12/Example!$B$9),EDATE(Example!$B$7,-($B$4-$A12)*12/Example!$B$9)))
Time t in periods (G12)=IF($A12="","",$B$7+$A12-1)
Discount factor (I12)=IF($A12="","",(1+$B$8/Example!$B$9)^(-G12))
Present value (J12)=IF($A12="","",E12*I12)
Macaulay duration (F6)=IF(Example!$C$19,SUM(K12:K411)/F4/Example!$B$9,"")
Convexity (F8)=IF(Example!$C$19,SUM(L12:L411)/(F4*(1+Example!$B$22/Example!$B$9)^2*Example!$B$9^2),"")

Macaulay duration is the present-value-weighted average time to the cash flows, in years. Modified duration divides it by (1 + YTM ÷ f) and approximates the percentage price change for a 1-point change in yield. Convexity measures the curve. Microsoft describes duration as "the weighted average of the present value of cash flows" used "as a measure of a bond price's response to changes in yield" (Microsoft Support, DURATION function).

ΔP ÷ P ≈ − modified duration × Δy + ½ × convexity × Δy²

Two independent cross-checks

Worked example from the sample data

The fictional Example Corp bond pays a 5.00% coupon twice a year, matures on 15 Aug 2036 and is callable at 100 from 15 Aug 2031. It settles on 12 Nov 2026 at a clean price of 103.40 per 100, on 30/360. Face amount: $10,000.

Accrued interest and cost

Yields

Cash flows

20 coupons are left. The first is 0.5167 of a period away (93 ÷ 180 days), so every time t ends in .5167:

No.DateCash per 100t (periods)Discount factorPresent value
12027-02-152.50000.51670.9884112.4710
22027-08-152.50001.51670.9663612.4159
32028-02-152.50002.51670.9448042.3620
42028-08-152.50003.51670.9237272.3093
…
202036-08-15102.500019.51670.64383565.9930

The present values add up to 104.608333, the dirty price. Weighted by time they give a Macaulay duration of 7.788 years, a modified duration of 7.614 and a convexity of 70.66. A 1 bp rise in yield takes about $7.97 off the $10,000 position (DV01).

If yields move

Price change of the dirty price, exact (re-priced with PRICE) and estimated:

Yield changeNew YTMExact dirty priceExact changeDuration onlyDuration + convexity
-300 bp1.56%132.20+26.37%+22.84%+26.02%
-200 bp2.56%122.12+16.74%+15.23%+16.64%
-100 bp3.56%112.96+7.98%+7.61%+7.97%
-50 bp4.06%108.68+3.90%+3.81%+3.90%
+50 bp5.06%100.72−3.72%−3.81%−3.72%
+100 bp5.56%97.00−7.27%−7.61%−7.26%
+200 bp6.56%90.06−13.91%−15.23%−13.82%
+300 bp7.56%83.73−19.96%−22.84%−19.66%

At ±100 bp, duration alone is off by about 0.34 points; adding convexity brings it within 0.01 points. The table treats the bond as non-callable. A callable bond trading above its call price may rise less than this when yields fall, because the issuer is more likely to call it.

Price at a target yield

At a target yield of 4.75%, =PRICE(B6,B7,B8,B16,C11,B9,C12) gives a clean price of 101.9270, a dirty price of 103.1353 and a cost of $10,313.53 for $10,000 face.

Checked against published examples

The Example tab re-runs these published results with live formulas, and check.py re-computes them with an independent Python solver (own coupon calendar and day counts, Brent's method for the yield):

SourceInputsPublishedThis file
Microsoft, YIELD function15 Feb 2008 → 15 Nov 2016, 5.75% coupon, price 95.04287, semiannual, 30/3606.5%6.5000%
Microsoft, PRICE function15 Feb 2008 → 15 Nov 2017, 5.75% coupon, 6.50% yield$94.6394.6344
31 CFR 356, Appendix B, Example A8 3/4% 30-year Treasury bond, 15 May 1990 → 15 May 2020, yield 8.84%99.05789399.057893
Same bond, RATE on 60 whole half-years=RATE(60, 4.375, −99.057893, 100) × 28.84%8.8400%
Microsoft, DURATION function1 Jul 2018 → 1 Jan 2048, 8% coupon, 9% yield, act/act; cash-flow method in this file10.919145310.9191453
Microsoft, MDURATION function1 Jan 2008 → 1 Jan 2016, 8% coupon, 9% yield, act/act; cash-flow method5.7365.7357
FINRA, current yield4.5% coupon, price 1034.37%4.37%

The Treasury example comes from the auction rule's own price formula, P[1 + (r/s)(i/2)] = (C/2)(r/s) + (C/2)an + 100vn, which the rule resolves to "P = 99.057893". In LibreOffice Calc the built-in DURATION returned 10.9215740 and MDURATION 5.7339 on Microsoft's two examples, not 10.9191453 and 5.736. That is why the file computes duration from the cash flows and shows the built-ins only as a check.

Comparing bonds after tax

A taxable bond and a municipal bond with the same yield do not leave you the same money. The comparison tab puts each bond's yield to worst on one footing: the after-tax yield, and the taxable yield that would leave you the same after tax.

after-tax yield = YTW × (1 − tax rate on its interest)

taxable-equivalent yield = after-tax yield ÷ (1 − federal − state)

TypeTax rate appliedBasis
Taxable (corporate bonds, CDs)federal + stateInterest is taxable
US Treasuryfederal only"Stocks and obligations of the United States Government are exempt from taxation by a State or political subdivision of a State" (31 U.S.C. 3124)
Muni in-state0"Interest you receive on an obligation issued by a state or local government generally is not taxable" (IRS Publication 550); state exemption see next row
Muni out-of-statestate only"For interest on a municipal bond to be free from state and local taxes, the buyer generally must be a resident of the state where the bond was issued, although there are exceptions" (MSRB)

Formulas from the Example comparison tab (row 10; C5 and C6 are the federal and state rates):

Result (Example tab cell)Formula in the file
Tax rate on its interest (S10)=IF($K10="OK",IF($B10="Taxable",$C$5+$C$6,IF($B10="US Treasury",$C$5,IF($B10="Muni in-state",0,$C$6))),"")
After-tax yield (T10)=IF(ISNUMBER($L10),$O10*(1-$S10),"")
Taxable-equivalent yield (U10)=IF(ISNUMBER($L10),IF($C$5+$C$6<1,$T10/(1-$C$5-$C$6),"n/a"),"")

Example comparison, with fictional bonds and example tax rates of 24% federal and 5% state (not anyone's actual rates):

Bond (fictional)TypePriceYTMYTCYTWMod. dur.Tax rateTaxable-equiv.Rank
Example Corp 5.00% 2036Taxable103.404.563%4.203%4.203%7.6129%4.203%4
Example Treasury-style 4.125% 2031US Treasury99.604.214%–4.214%4.3924%4.511%3
Example City GO 3.25% 2035Muni in-state98.103.509%3.631%3.509%7.290%4.942%1
Example County Water 3.50% 2038Muni out-of-state99.253.577%–3.577%9.605%4.786%2
Example Corp zero-coupon 2033Taxable76.803.802%–3.802%6.8829%3.802%5

The in-state municipal bond has the lowest yield to worst (3.509%) but the highest taxable-equivalent yield (4.942%) at these rates; the callable corporate bond drops to last but one once tax and the call are counted. At a 0% tax rate the order would follow yield to worst instead. The MSRB notes that issuers "sometimes issue taxable bonds", so check the bond's official statement before choosing the type.

The tax maths is simplified. It adds the federal and state rates, applies them to the whole yield, and ignores state-tax deductibility, the alternative minimum tax, the 3.8% net investment income tax, market-discount and premium-amortisation rules, and capital gains. Treat it as a first screen, not a tax calculation.

Duration: how much the price can move

The SEC puts the core rule in one line: "A fundamental principle of bond investing is that market interest rates and bond prices generally move in opposite directions" (SEC, Interest rate risk). FINRA explains that "duration signals how much the price of your bond investment is likely to fluctuate when there is an up or down movement in interest rates", and gives the rule of thumb that "a bond fund with 10-year duration will decrease in value by 10 percent if interest rates rise one percent" (FINRA, Duration—What an Interest Rate Hike Could Do to Your Bond Portfolio). The same alert warns that duration assumes a symmetric move, and "this isn't always the case". The scenario table above shows the size of that gap for one bond.

Holding to maturity avoids selling at a loss after rates rise, but only if the issuer pays. YTM is a promised yield, not a guaranteed one.

Common mistakes

Limits

FAQ

How do you calculate yield to maturity in Excel?

Use =YIELD(settlement, maturity, rate, pr, redemption, frequency, basis). Dates go in as real dates, rate is the annual coupon (5% or 0.05), pr is the clean price per 100 of face, redemption is usually 100, frequency is 2 for semiannual coupons and basis is the day count (0 = 30/360, 1 = actual/actual). With Microsoft's sample inputs (settlement 15 Feb 2008, maturity 15 Nov 2016, 5.75% coupon, price 95.04287) YIELD returns 6.5%. This template wraps YIELD with input checks and a cash-flow cross-check.

What is the difference between yield to maturity, coupon rate and current yield?

The coupon rate is fixed when the bond is issued. Current yield is the annual coupon divided by today's price, so it ignores the gain or loss as the price moves to 100 at maturity. Yield to maturity is the discount rate that makes the present value of all remaining coupons and principal equal the price you pay, so it includes that gain or loss. A bond bought below 100 has a YTM above its current yield; a bond bought above 100 has a YTM below it.

How do you calculate yield to maturity without the YIELD function?

When you buy on a coupon date, use RATE: =RATE(periods left, coupon per period, -price, redemption) x coupons per year. For the Treasury bond in 31 CFR Part 356 Appendix B, =RATE(60, 4.375, -99.057893, 100)*2 gives 8.84%, the yield in the rule. Between coupon dates RATE is off because the first period is a fraction, which is why YIELD (or a cash-flow table discounted at fractional periods) is needed.

Why does Excel's YIELD function return #NUM!?

YIELD returns #NUM! when settlement is on or after maturity, when the rate is below 0, when the price or redemption is 0 or less, when frequency is not 1, 2 or 4, or when basis is outside 0 to 4. It returns #VALUE! when a date is not a valid date. Typing a coupon of 5 instead of 5% is a common cause. The template checks each input and says what to fix instead of showing an error.

What is the difference between yield to call and yield to worst?

Yield to call is worked out like yield to maturity but uses the call date and call price instead of the maturity date and 100. FINRA defines yield to worst as whichever of a bond's YTM and YTC is lower. For a bond bought above par, the call usually gives the lower yield; for a bond bought below par, maturity usually does.

Does the YIELD function work in Google Sheets?

Yes. Google Sheets has YIELD, PRICE, DURATION, MDURATION, RATE and the COUP functions (COUPNUM, COUPPCD, COUPNCD, COUPDAYBS, COUPDAYS, COUPDAYSNC) with the same arguments as Excel. Import the .xlsx with File > Import > Upload. LibreOffice Calc has them too, but its DURATION and MDURATION gave slightly different results from Microsoft's published examples, so this file calculates duration from the cash flows instead.

Related tools and templates

Educational template only, not investment or tax advice. Example data is fictional: the bonds, prices, call terms and tax rates are made up to show the formulas and are not quotes, offers or recommendations. Bond prices fall when yields rise, and you can lose money if you sell before maturity or the issuer defaults. Sources: FINRA, Bond Yield and Return (finra.org); FINRA, Duration alert (finra.org); SEC, Interest rate risk (sec.gov); Microsoft Support, YIELD, PRICE, RATE, DURATION and MDURATION functions (support.microsoft.com); 31 CFR Part 356, Appendix B (law.cornell.edu); MSRB, Municipal Bond Basics and About EMMA (msrb.org); IRS Publication 550 (irs.gov); 31 U.S.C. 3124 (law.cornell.edu). Retrieved 10 November 2026.