> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coingecko.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CoinGecko for Microsoft Excel

> Pull live prices, historical data, NFT floors, onchain token prices, and market cap rankings into Excel with =CG. formulas

<Frame>
  <img src="https://mintcdn.com/coingecko/i9l2MT4etZGYjSx8/assets/images/excel-hero.png?fit=max&auto=format&n=i9l2MT4etZGYjSx8&q=85&s=f75ca548d137174b388934fecf032864" width="1366" height="768" data-path="assets/images/excel-hero.png" />
</Frame>

<Note>
  The add-in only communicates with the CoinGecko API using your saved API key. No personal data is sent to any third party.
</Note>

## Quick Start

<Steps>
  <Step title="Install">
    Search for **CoinGecko** in the Excel Add-ins store, or visit the [Microsoft Marketplace](https://marketplace.microsoft.com/en-us/product/office/WA200010662).

    <Frame>
      <img src="https://mintcdn.com/coingecko/i9l2MT4etZGYjSx8/assets/images/excel-install.png?fit=max&auto=format&n=i9l2MT4etZGYjSx8&q=85&s=378af18a49fdcdd55f7815037ca9208e" noZoom width="842" height="488" data-path="assets/images/excel-install.png" />
    </Frame>
  </Step>

  <Step title="Open the Taskpane">
    Go to **Home** > **CoinGecko** in the Excel ribbon.
  </Step>

  <Step title="Set API key">
    Enter your [CoinGecko API key](https://www.coingecko.com/en/api/pricing) and click **Save Settings**. A green status dot confirms a valid connection.

    <Frame>
      <img src="https://mintcdn.com/coingecko/i9l2MT4etZGYjSx8/assets/images/excel-api-key.png?fit=max&auto=format&n=i9l2MT4etZGYjSx8&q=85&s=acd9fcc55606414750d9906bca5d05c5" width="2481" height="1378" data-path="assets/images/excel-api-key.png" />
    </Frame>
  </Step>
</Steps>

## Formulas

All formulas use the `CG` namespace. Enter them in any cell like a standard Excel formula.

<Tip>
  Use the **Coin ID** (e.g. `bitcoin`, `ethereum`) rather than the ticker symbol for the most reliable results.

  * Find the coin ID in the URL on CoinGecko — e.g. `coingecko.com/en/coins/bitcoin`
  * Browse the full list via [Coins List](/reference/coins-list) endpoint or this [Google Sheet](https://docs.google.com/spreadsheets/d/1wTTuxXt8n9q7C4NDXqQpI3wpKu1_5bGVmP9Xz0XGSyU/edit?gid=0#gid=0)
</Tip>

***

### `=CG.PRICE(id)`

Returns the **current USD price** of a coin.

| Parameter | Type   | Description                                                                                                                                      |
| --------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `id`      | string | [Coin ID](https://docs.google.com/spreadsheets/d/1wTTuxXt8n9q7C4NDXqQpI3wpKu1_5bGVmP9Xz0XGSyU/edit?gid=0#gid=0) (e.g. `"bitcoin"`, `"ethereum"`) |

```text theme={null}
=CG.PRICE("bitcoin")       → 95000
=CG.PRICE("ethereum")      → 3400
=CG.PRICE("solana")        → 180
```

***

### `=CG.HISTORY(id, date)`

Returns the **historical USD price** of a coin on a specific date.

| Parameter | Type   | Description                                                                                                     |
| --------- | ------ | --------------------------------------------------------------------------------------------------------------- |
| `id`      | string | [Coin ID](https://docs.google.com/spreadsheets/d/1wTTuxXt8n9q7C4NDXqQpI3wpKu1_5bGVmP9Xz0XGSyU/edit?gid=0#gid=0) |
| `date`    | string | Date in `YYYY-MM-DD` format                                                                                     |

```text theme={null}
=CG.HISTORY("bitcoin", "2023-12-31")       → 16541.77
=CG.HISTORY("ethereum", "2021-12-31")      → 3682.45
```

***

### `=CG.NFT(id)`

Returns the **current floor price (USD)** of an NFT collection.

| Parameter | Type   | Description                                                                                                                                                    |
| --------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`      | string | [NFT ID](https://docs.google.com/spreadsheets/d/1wTTuxXt8n9q7C4NDXqQpI3wpKu1_5bGVmP9Xz0XGSyU/edit?gid=207968092#gid=207968092) (e.g. `"bored-ape-yacht-club"`) |

```text theme={null}
=CG.NFT("bored-ape-yacht-club")      → 24500
=CG.NFT("cryptopunks")               → 68000
=CG.NFT("pudgy-penguins")            → 8200
```

***

### `=CG.ONCHAIN(network, address)`

Returns the **current USD price** of an onchain token by network and contract address.

| Parameter | Type   | Description                                                                                                                                                              |
| --------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `network` | string | [Network ID](https://docs.google.com/spreadsheets/d/1wTTuxXt8n9q7C4NDXqQpI3wpKu1_5bGVmP9Xz0XGSyU/edit?gid=1120233236#gid=1120233236) (e.g. `"eth"`, `"bsc"`, `"solana"`) |
| `address` | string | Token contract address                                                                                                                                                   |

```text theme={null}
=CG.ONCHAIN("eth", "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48")
=CG.ONCHAIN("bsc", "0x55d398326f99059ff775485246999027b3197955")
```

Common network IDs: `eth`, `bsc`, `solana`, `arbitrum`, `base`

***

### `=CG.TOP(limit, [category])`

Returns a **ranked table of top coins by market cap**.<br />
*\*results spill into adjacent rows and columns.*

<Frame>
  <img src="https://mintcdn.com/coingecko/i9l2MT4etZGYjSx8/assets/images/excel-top-output.png?fit=max&auto=format&n=i9l2MT4etZGYjSx8&q=85&s=6d9ff2435a10cb07fb31c55717aa02dd" width="1744" height="1118" data-path="assets/images/excel-top-output.png" />
</Frame>

| Parameter  | Type                | Description                                                                                                                                           |
| ---------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `limit`    | number              | Number of coins (1–10000)                                                                                                                             |
| `category` | string *(optional)* | [Category ID](https://docs.google.com/spreadsheets/d/1wTTuxXt8n9q7C4NDXqQpI3wpKu1_5bGVmP9Xz0XGSyU/edit?gid=214581757#gid=214581757) to filter results |

```text theme={null}
=CG.TOP(10)                              → Top 10 coins by market cap
=CG.TOP(100)                             → Top 100 coins by market cap
=CG.TOP(50, "decentralized-exchange")    → Top 50 DEX tokens
=CG.TOP(20, "layer-1")                   → Top 20 Layer-1 coins
```

<Note>
  Enter `=CG.TOP(...)` in a single cell and leave adjacent cells empty so the array can spill.
</Note>

***

## Taskpane

<Frame>
  <img src="https://mintcdn.com/coingecko/i9l2MT4etZGYjSx8/assets/images/excel-taskpane.png?fit=max&auto=format&n=i9l2MT4etZGYjSx8&q=85&s=38a2f98af6a415f8b34c187b06454e7a" width="1366" height="768" data-path="assets/images/excel-taskpane.png" />
</Frame>

* **Refresh All Data** — clears the cache and forces all `=CG.*` formulas to recalculate with fresh API data.
* **Save** — saves your API key and plan selection, validates the key, and clears the cache.

***

## FAQ

<Accordion title="Why is my formula showing #NAME?">
  Ensure the add-in is installed and loaded. The `CG` namespace is only available when the add-in is active.
</Accordion>

<Accordion title="How do I find a Coin ID or NFT ID?">
  Use the [full ID list](https://docs.google.com/spreadsheets/d/1wTTuxXt8n9q7C4NDXqQpI3wpKu1_5bGVmP9Xz0XGSyU/edit?gid=0#gid=0), or find the "API ID" on the coin's [CoinGecko](https://www.coingecko.com) page.
</Accordion>

<Accordion title="Why am I seeing Error: Invalid API Key?">
  Open the taskpane, re-enter your API key, and click **Save**.
</Accordion>

<Accordion title="Why am I seeing Error: Rate Limit?">
  You've exceeded the API rate limit. Wait a moment, then click **Refresh All Data**.
</Accordion>

<Accordion title="Why does =CG.HISTORY return no data?">
  Confirm the date is in `YYYY-MM-DD` format and that the coin existed on that date.
</Accordion>

<Accordion title="Why does =CG.TOP only show one cell?">
  Make sure the cells below and to the right are empty so the array can spill.
</Accordion>

<Accordion title="What is the privacy policy?">
  View the full [privacy policy](/docs/excel/privacy-policy).
</Accordion>

<Accordion title="What are the terms of use?">
  View the full [terms of use](/docs/excel/terms).
</Accordion>

***

<Card title="Share Feedback" icon="comment" href="https://forms.gle/Ndm7qRC3QVE4YYhB7">
  Have questions or feedback? Let us know.
</Card>
