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.
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.
| Input (yellow cells) | Example | Result | Example |
|---|---|---|---|
| Settlement date | 12 Nov 2026 | Yield to maturity | 4.563% |
| Maturity date | 15 Aug 2036 | Yield to call | 4.203% |
| Annual coupon | 5.00% | Yield to worst | 4.203% |
| Coupons per year | 2 | Accrued interest per 100 | 1.208333 |
| Clean price per 100 | 103.40 | Dirty price per 100 | 104.608333 |
| Day-count basis | 0 (US 30/360) | Modified duration | 7.614 |
| Call date / call price | 15 Aug 2031 / 100 | Convexity | 70.66 |
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:
- Current yield. "Current yield is the bond's coupon yield divided by its current market price" (FINRA). It ignores the move to 100 at maturity.
- Yield to call. FINRA: YTC "is figured the same way as YTM, except instead of plugging in the number of months until a bond matures, you use a call date and the bond's call price."
- Yield to worst. "Yield to worst (YTW) is whichever of a bond's YTM and YTC is lower" (FINRA). The MSRB adds that yield to worst "is often the same as yield to call for bonds priced at a premium" (MSRB, Municipal Bond Basics).
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
| Tab | What you type | What it calculates |
|---|---|---|
| Start here | Nothing | Steps, formulas in plain words, colour key, limits, sources, disclaimer |
| Summary | Nothing | Your 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 calculator | Settlement and maturity dates, coupon, coupons per year, clean price, optional redemption, day-count basis, face amount, call date and price, target yield, yield change | YTM, 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 flows | Nothing | Up 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 comparison | Settlement 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 comparison | Already filled with fictional bonds | The same tabs with every result visible, plus seven published worked examples re-run with live formulas |
How to use it
- 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.
- On Bond calculator, type the settlement date (the day you pay), the maturity date and the annual coupon as a percentage.
- 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.
- 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.
- If the bond is callable, add the first call date and the call price. Add your face amount to see the cost in dollars.
- 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.
- 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:
| Basis | Day count | Typical use |
|---|---|---|
| 0 or blank | US (NASD) 30/360 | US corporate and municipal bonds |
| 1 | Actual/actual | US Treasury notes and bonds |
| 2 | Actual/360 | Some money-market and floating-rate paper |
| 3 | Actual/365 | Some non-US bonds |
| 4 | European 30/360 | Some 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
- Cash-flow check. The present values on the Cash flows tab must add up to the dirty price. In the Example the difference is 0.000000000. If it is ever off by more than 0.0001, the sheet warns that YIELD did not fully converge.
- RATE check. On a coupon date there are only whole periods, so the yield is a plain annuity rate:
=RATE(N, 100 × coupon ÷ f, −price, redemption) × f. The sheet shows it whenever settlement falls on a coupon date. Between coupon dates (as in the Example) RATE does not apply, because the first period is a fraction.
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
- Previous coupon 15 Aug 2026, next coupon 15 Feb 2027. On 30/360: A = 87 days since the last coupon, E = 180 days in the period, DSC = 93 days to the next one.
- Accrued interest = 100 × 5% ÷ 2 × 87 ÷ 180 = 1.208333 per 100, or $120.83 on $10,000.
- Dirty price = 103.40 + 1.208333 = 104.608333. Total cost before commissions = $10,340.00 + $120.83 = $10,460.83.
Yields
- Yield to maturity = 4.563%. It is below the 5.00% coupon because the buyer pays 103.40 and gets 100 back.
- Current yield = 5 ÷ 103.40 = 4.836%.
- Yield to call (15 Aug 2031, price 100) = 4.203%. The premium is lost over fewer years, so the call is worse for the buyer.
- Yield to worst = lower of the two = 4.203%. That is the number to compare with other bonds.
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. | Date | Cash per 100 | t (periods) | Discount factor | Present value |
|---|---|---|---|---|---|
| 1 | 2027-02-15 | 2.5000 | 0.5167 | 0.988411 | 2.4710 |
| 2 | 2027-08-15 | 2.5000 | 1.5167 | 0.966361 | 2.4159 |
| 3 | 2028-02-15 | 2.5000 | 2.5167 | 0.944804 | 2.3620 |
| 4 | 2028-08-15 | 2.5000 | 3.5167 | 0.923727 | 2.3093 |
| … | |||||
| 20 | 2036-08-15 | 102.5000 | 19.5167 | 0.643835 | 65.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 change | New YTM | Exact dirty price | Exact change | Duration only | Duration + convexity |
|---|---|---|---|---|---|
| -300 bp | 1.56% | 132.20 | +26.37% | +22.84% | +26.02% |
| -200 bp | 2.56% | 122.12 | +16.74% | +15.23% | +16.64% |
| -100 bp | 3.56% | 112.96 | +7.98% | +7.61% | +7.97% |
| -50 bp | 4.06% | 108.68 | +3.90% | +3.81% | +3.90% |
| +50 bp | 5.06% | 100.72 | −3.72% | −3.81% | −3.72% |
| +100 bp | 5.56% | 97.00 | −7.27% | −7.61% | −7.26% |
| +200 bp | 6.56% | 90.06 | −13.91% | −15.23% | −13.82% |
| +300 bp | 7.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):
| Source | Inputs | Published | This file |
|---|---|---|---|
| Microsoft, YIELD function | 15 Feb 2008 → 15 Nov 2016, 5.75% coupon, price 95.04287, semiannual, 30/360 | 6.5% | 6.5000% |
| Microsoft, PRICE function | 15 Feb 2008 → 15 Nov 2017, 5.75% coupon, 6.50% yield | $94.63 | 94.6344 |
| 31 CFR 356, Appendix B, Example A | 8 3/4% 30-year Treasury bond, 15 May 1990 → 15 May 2020, yield 8.84% | 99.057893 | 99.057893 |
| Same bond, RATE on 60 whole half-years | =RATE(60, 4.375, −99.057893, 100) × 2 | 8.84% | 8.8400% |
| Microsoft, DURATION function | 1 Jul 2018 → 1 Jan 2048, 8% coupon, 9% yield, act/act; cash-flow method in this file | 10.9191453 | 10.9191453 |
| Microsoft, MDURATION function | 1 Jan 2008 → 1 Jan 2016, 8% coupon, 9% yield, act/act; cash-flow method | 5.736 | 5.7357 |
| FINRA, current yield | 4.5% coupon, price 103 | 4.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)
| Type | Tax rate applied | Basis |
|---|---|---|
| Taxable (corporate bonds, CDs) | federal + state | Interest is taxable |
| US Treasury | federal 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-state | 0 | "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-state | state 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) | Type | Price | YTM | YTC | YTW | Mod. dur. | Tax rate | Taxable-equiv. | Rank |
|---|---|---|---|---|---|---|---|---|---|
| Example Corp 5.00% 2036 | Taxable | 103.40 | 4.563% | 4.203% | 4.203% | 7.61 | 29% | 4.203% | 4 |
| Example Treasury-style 4.125% 2031 | US Treasury | 99.60 | 4.214% | – | 4.214% | 4.39 | 24% | 4.511% | 3 |
| Example City GO 3.25% 2035 | Muni in-state | 98.10 | 3.509% | 3.631% | 3.509% | 7.29 | 0% | 4.942% | 1 |
| Example County Water 3.50% 2038 | Muni out-of-state | 99.25 | 3.577% | – | 3.577% | 9.60 | 5% | 4.786% | 2 |
| Example Corp zero-coupon 2033 | Taxable | 76.80 | 3.802% | – | 3.802% | 6.88 | 29% | 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
- Typing the dirty price. YIELD wants the clean price. If your broker shows a total with accrued interest, subtract the accrued interest first.
- Typing 5 instead of 5%. The coupon and target yield are rates. The input check catches values of 1 or more.
- Using the trade date. Settlement is when you pay, usually the next business day for US bonds. Accrued interest is counted to settlement.
- Wrong day count. Treasuries use actual/actual (basis 1); US corporate and municipal bonds use 30/360 (basis 0). The wrong basis shifts accrued interest and the yield slightly.
- Quoting YTM on a premium callable bond. If the call date gives a lower yield, the yield to worst is the realistic figure.
- Comparing pre-tax yields across bond types. Use the after-tax or taxable-equivalent column, with your own rates.
Limits
- Fixed-rate bonds with regular coupons only. No floating-rate notes, TIPS inflation adjustment, sinking funds, step-ups or odd first and last coupons (Excel's ODDFYIELD and ODDLYIELD handle odd periods).
- One call date per bond. Bonds with a call schedule need a yield for each date; the lowest is the yield to worst.
- Duration and convexity run to maturity, even for callable bonds. Commissions and dealer markups are not included.
- In the last coupon period Microsoft documents a simple-interest formula for YIELD, while LibreOffice keeps compounding; results can differ slightly there and the sheet shows a note.
- For basis 4 (European 30/360) the days to the next coupon follow LibreOffice (E − A); at some month-ends other programs may count one day differently.
- Tested by recalculation in LibreOffice; the file uses only functions that exist in Excel 2016+ and Google Sheets. Not tested inside Google Sheets itself.
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
- Bond ladder spreadsheetPlan maturities and income by year
- CD ladder spreadsheetStagger CD terms and rates
- I bond trackerTrack Series I savings bonds
- CAGR calculatorAnnual growth rate between two values
- APR calculatorAnnual rate from fees and payments
- Capital gains tax calculatorTax on a sale before maturity
- All templatesFree spreadsheets
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.