GitBook Assistant Ask chevron-down 🔌 Integrationschevron-right Excel Add-in chevron-right How-To Guides 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 & Setup chevron-right 1. The GOV_YIELD Function
Use the BlueGamma function to fetch government bond yields:
ISO 2-letter country code (e.g., US, DE, GB)
Maturity as a tenor (e.g., 10Y) or date (2035-12-15)
Forward start tenor or date. Defaults to spot.
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:
Row
A (Tenor)
B (Yield Formula)
=BlueGamma.GOV_YIELD($B$1, A3)
=BlueGamma.GOV_YIELD($B$1, A4)
=BlueGamma.GOV_YIELD($B$1, A5)
=BlueGamma.GOV_YIELD($B$1, A6)
=BlueGamma.GOV_YIELD($B$1, A7)
=BlueGamma.GOV_YIELD($B$1, A8)
=BlueGamma.GOV_YIELD($B$1, A9)
=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:
Cashflow Schedule (Row 5 = headers, Row 6+ = data):
Column
Header
Formula (Row 6)
=BlueGamma.GOV_YIELD($B$1, B6)
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
Country Code
Description
Currency
Japanese Government Bond yields
Canadian Government Bond yields
Australian Government Bond yields
=BlueGamma.GOV_YIELD("US", "10Y")
=BlueGamma.GOV_YIELD("US", "2030-06-15")
=BlueGamma.GOV_YIELD("US", "10Y", "1Y")
=BlueGamma.GOV_YIELD("US", "10Y", , "2024-06-30")
=BlueGamma.GOV_YIELD("US", "10Y", "1Y", "2024-06-30")
Troubleshooting
Check country code is valid (e.g., "US" not "USA")
Verify you're using the correct country code for your currency
Check the valuation date is a valid business day
Key Conventions
Government bond yields in BlueGamma use the following conventions:
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 trialarrow-up-right and start using the Excel Add-in today.