> For the complete documentation index, see [llms.txt](https://bluegamma.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bluegamma.io/documentation/integrations/excel-add-in/how-to-guides/how-to-pull-bond-yields-in-excel.md).

# How to Pull Bond Yields in Excel

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:

{% content-ref url="/pages/cIh9SrulGOViAKc9OE27" %}
[Installation & Setup](/documentation/integrations/excel-add-in/installation-and-setup.md)
{% endcontent-ref %}

***

### 1. The GOV\_YIELD Function

Use the BlueGamma function to fetch government bond yields:

```
=BlueGamma.GOV_YIELD(country_code, maturity, [forward_start], [valuation_date])
```

| Parameter        | Type                | Description                                              |
| ---------------- | ------------------- | -------------------------------------------------------- |
| `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:

```
=BlueGamma.GOV_YIELD("US", "10Y")
```

To get the 5-year German Bund yield:

```
=BlueGamma.GOV_YIELD("DE", "5Y")
```

**Tip:** Multiply by 100 to display as a percentage:

```
=BlueGamma.GOV_YIELD("US", "10Y") * 100
```

***

### 3. Build a Full Yield Curve

Set up your spreadsheet to pull yields across multiple maturities:

| Cell | Content      |
| ---- | ------------ |
| A1   | Country Code |
| B1   | US           |

| Row | A (Tenor) | B (Yield Formula)                 |
| --- | --------- | --------------------------------- |
| 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.

{% hint style="success" %}
**Need live treasury yields in your model?** Book a demo and we'll get you set up on a trial. [Book a demo →](https://app.lemcal.com/@alivohra/website-demo?back=1)
{% endhint %}

***

### 4. Use Specific Maturity Dates

For DCF models, you often need yields for exact dates rather than standard tenors. The `maturity` parameter accepts dates:

```
=BlueGamma.GOV_YIELD("US", "2030-06-15")
```

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:**

| Cell | Parameter     | Value |
| ---- | ------------- | ----- |
| B1   | Country       | US    |
| B2   | Credit Spread | 1.50% |

**Cashflow Schedule (Row 5 = headers, Row 6+ = data):**

| Column | Header          | Formula (Row 6)                  |
| ------ | --------------- | -------------------------------- |
| 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:

```
=BlueGamma.GOV_YIELD("US", "10Y", , "2024-06-30")
```

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`:

```
=BlueGamma.GOV_YIELD("US", "10Y", "1Y")
```

This returns the 10-year yield, 1 year forward — useful for forward-looking project finance models.

***

### Available Countries

| Country Code | Description                       | Currency |
| ------------ | --------------------------------- | -------- |
| `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

| Use Case           | Formula                                                 |
| ------------------ | ------------------------------------------------------- |
| 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

| Issue                   | Solution                                                       |
| ----------------------- | -------------------------------------------------------------- |
| #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](/documentation/methodology/government-bond-curves.md)

***

**Ready to pull live treasury yields into your model?**

[Create a free BlueGamma trial](https://auth.bluegamma.io/sign-up) and start using the Excel Add-in today.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://bluegamma.io/documentation/integrations/excel-add-in/how-to-guides/how-to-pull-bond-yields-in-excel.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
