How to Pull Bond Yields in Excel
Pull government bond yields directly into Excel for discount rates, DCF models, and risk-free rate benchmarking using BlueGamma's Excel Add-in.
Government bond yields are essential for financial modelling — whether you're building discount rates for a DCF, benchmarking credit spreads, or setting hurdle rates for project finance. BlueGamma's Excel Add-in lets you pull live treasury yields directly into your model.
Common Use Cases
Discount rates — Use treasury yields as the risk-free component in WACC calculations
DCF models — Pull yields for specific maturities matching your cashflow dates
Credit spread analysis — Compare corporate yields to government benchmarks
Project finance — Set base rates for long-dated infrastructure models
Before You Start
To follow this guide, make sure you have:
Installed the BlueGamma Excel Add-in
Signed in through the BlueGamma tab in Excel
An active BlueGamma trial or subscription
If you haven't set this up yet, see:
Installation & Setup1. The GOV_YIELD Function
Use the BlueGamma function to fetch government bond yields:
country_code
string
ISO 2-letter country code (e.g., US, DE, GB)
maturity
string
Maturity as a tenor (e.g., 10Y) or date (2035-12-15)
forward_start
string (optional)
Forward start tenor or date. Defaults to spot.
valuation_date
string (optional)
Historical valuation date. Defaults to live.
Returns: Zero-coupon yield as a decimal (e.g., 0.0419 for 4.19%)
2. Pull a Single Yield
To get the current 10-year US Treasury yield:
To get the 5-year German Bund yield:
Tip: Multiply by 100 to display as a percentage:
3. Build a Full Yield Curve
Set up your spreadsheet to pull yields across multiple maturities:
A1
Country Code
B1
US
3
1Y
=BlueGamma.GOV_YIELD($B$1, A3)
4
2Y
=BlueGamma.GOV_YIELD($B$1, A4)
5
3Y
=BlueGamma.GOV_YIELD($B$1, A5)
6
5Y
=BlueGamma.GOV_YIELD($B$1, A6)
7
7Y
=BlueGamma.GOV_YIELD($B$1, A7)
8
10Y
=BlueGamma.GOV_YIELD($B$1, A8)
9
20Y
=BlueGamma.GOV_YIELD($B$1, A9)
10
30Y
=BlueGamma.GOV_YIELD($B$1, A10)
This gives you a complete yield curve you can chart or use in calculations.
4. Use Specific Maturity Dates
For DCF models, you often need yields for exact dates rather than standard tenors. The maturity parameter accepts dates:
This returns the interpolated yield for a bond maturing on that specific date — perfect for matching your cashflow schedule.
5. Build Discount Rates for a DCF
Here's a practical example: building discount rates for a 5-year DCF model.
Setup:
B1
Country
US
B2
Credit Spread
1.50%
Cashflow Schedule (Row 5 = headers, Row 6+ = data):
A
Year
1, 2, 3, 4, 5
B
Cashflow Date
Your cashflow dates
C
Risk-Free Rate
=BlueGamma.GOV_YIELD($B$1, B6)
D
Discount Rate
=C6 + $B$2
E
Discount Factor
=1 / (1 + D6) ^ A6
F
Cashflow
Your projected cashflows
G
Present Value
=F6 * E6
The risk-free rate pulls directly from the treasury curve, and you add your credit spread to get the full discount rate.
6. Historical Yields
For backtesting or historical analysis, add a valuation date:
Note the empty parameter for forward_start — use a comma to skip it when you only need the valuation date.
7. Forward-Starting Yields
Need the yield for a bond starting in the future? Use forward_start:
This returns the 10-year yield, 1 year forward — useful for forward-looking project finance models.
Available Countries
US
US Treasury yields
USD
UK
UK Gilt yields
GBP
DE
German Bund yields
EUR
FR
French OAT yields
EUR
IT
Italian BTP yields
EUR
ES
Spanish Bonos yields
EUR
JP
Japanese Government Bond yields
JPY
CA
Canadian Government Bond yields
CAD
AU
Australian Government Bond yields
AUD
Formula Reference
Spot yield (tenor)
=BlueGamma.GOV_YIELD("US", "10Y")
Spot yield (date)
=BlueGamma.GOV_YIELD("US", "2030-06-15")
Forward yield
=BlueGamma.GOV_YIELD("US", "10Y", "1Y")
Historical yield
=BlueGamma.GOV_YIELD("US", "10Y", , "2024-06-30")
Full parameters
=BlueGamma.GOV_YIELD("US", "10Y", "1Y", "2024-06-30")
Troubleshooting
#VALUE! error
Check country code is valid (e.g., "US" not "USA")
Yield seems wrong
Verify you're using the correct country code for your currency
Historical data missing
Check the valuation date is a valid business day
Key Conventions
Government bond yields in BlueGamma use the following conventions:
Compounding: Semi-annual
Day Count: Actual/Actual
Output: Zero-coupon yields
For more details on methodology, see Government Bond Curves
Ready to pull live treasury yields into your model?
Create a free BlueGamma trial and start using the Excel Add-in today.
Last updated
Was this helpful?

