> For the complete documentation index, see [llms.txt](https://www.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://www.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

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 to the add-in (the **BlueGamma** button on the **Home** 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])
```

**Returns:** Zero-coupon yield as a decimal (e.g., `0.0419` for 4.19%)

For each parameter, see [Get Government Bond Yield](/documentation/integrations/excel-add-in/functions/get-government-bond-yield.md).

***

### 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.

***

### 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.

***

### Example Country Codes

These are the markets `GOV_YIELD` covers. Use `UK` for the United Kingdom, not `GB`.

| 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      |
| `AT`         | Austrian Government Bond yields     | EUR      |
| `BR`         | Brazilian Government Bond yields    | BRL      |
| `CN`         | Chinese Government Bond yields      | CNY      |
| `DK`         | Danish Government Bond yields       | DKK      |
| `EG`         | Egyptian Government Bond yields     | EGP      |
| `FI`         | Finnish Government Bond yields      | EUR      |
| `GR`         | Greek Government Bond yields        | EUR      |
| `ID`         | Indonesian Government Bond yields   | IDR      |
| `IN`         | Indian Government Bond yields       | INR      |
| `KR`         | South Korean Government Bond yields | KRW      |
| `MY`         | Malaysian Government Bond yields    | MYR      |
| `NL`         | Dutch Government Bond yields        | EUR      |
| `NZ`         | New Zealand Government Bond yields  | NZD      |
| `PL`         | Polish Government Bond yields       | PLN      |
| `PT`         | Portuguese Government Bond yields   | EUR      |
| `RO`         | Romanian Government Bond yields     | RON      |

A few other markets can return `Not enough traded bonds` when too few bonds trade to build a curve.

***

### 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")` |

***

### 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
