---
title: Use Excel with Deephaven
sidebar_label: Excel
---

Deephaven's Excel Client allows you to integrate Deephaven data directly into your spreadsheets through an Excel add-in. You can query static or dynamic tables and use the results in your calculations. As ticking data changes, dependent calculations in your sheet automatically update.

## Why use Excel with Deephaven?

The Excel integration bridges the gap between Deephaven's real-time data processing capabilities and Excel's familiar analysis environment. This is a powerful combination that allows you to:

**Work in a familiar environment** — Business analysts, traders, and financial professionals can access live Deephaven data without learning new tools or leaving Excel. Use the formulas, pivot tables, charts, and functions you already know.

**Real-time calculations** — When you subscribe to ticking tables, your Excel formulas automatically recalculate as data updates. Build dashboards that show live P&L, position tracking, or market analytics that refresh every few seconds.

**Bridge technical and business teams** — Data engineers can build complex queries and transformations in Deephaven, while business users consume the results in Excel. Each team works with their preferred tools.

**Combine powerful systems** — Leverage Deephaven's ability to handle billions of rows and complex streaming computations, then analyze filtered results with Excel's rich visualization and analysis features.

**Ad-hoc exploration** — Quickly test hypotheses and explore data without writing code. Filter Deephaven tables server-side using Deephaven filter expressions, then visualize results with Excel's charting tools.

This guide shows you how to install the add-in, connect to Deephaven, and fetch tables from your Persistent Queries.

## Prerequisites

Before installing the Excel add-in, ensure you have:

- The latest 64-bit version of [Microsoft Excel](https://www.microsoft.com/en-us/microsoft-365/excel) with [Microsoft Office 365](https://www.microsoft.com/en-us/microsoft-365) (or Office 2021 or later).
- A 64-bit Windows operating system.
- Access to the Excel add-in installer (contact Deephaven support if needed).

## Install the add-in

Close any open instances of Excel, then run the Deephaven Excel add-in installer.

![The Deephaven Excel Add-in Setup Wizard window](../../assets/how-to/excel/excel-installer.png)

Accept the default installation path and click **Next**:

![The Setup Wizard's installation path selection screen, with **Next** highlighted](../../assets/how-to/excel/excel-path.png)

Click **Install** to begin. You may be prompted to install [.NET Desktop Runtime](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) if you don't already have it.

When prompted to **Add Deephaven as Trusted Publisher**, click **Yes** to add Deephaven to your computer's list of [Trusted Publishers](https://learn.microsoft.com/en-us/microsoft-365-apps/security/trusted-publisher). This allows Excel to run Deephaven code.

![A pop-up panel in the Setup Wizard prompting the user to accept or reject adding Deephaven to the user's list of Trusted Publishers](../../assets/how-to/excel/excel-trusted-pub.png)

Click **Finish** to complete the installation.

## Connect to Deephaven

Open Excel and find "Add-ins" in the menu. In the Deephaven section of the ribbon, click **Connections**.

![The add-ins tab in Excel, with the Deephaven add-in displayed](../../assets/how-to/excel/excel-connections.png)

In the **Connection Manager**, select **New** to create a new connection.

![The Deephaven Excel Connections Manager window](../../assets/how-to/excel/new-connection.png)

Configure your connection:

1. Select **Enterprise Core+**.
2. Choose a **Connection ID** — a short identifier you'll use to reference this connection in Excel formulas (e.g., `con1+`).
3. Enter your JSON URL: `<your_server_address>:<port>/iris/connection.json`
   - Use port `8000` for servers with Envoy
   - Use port `8123` for servers without Envoy
   - Example: `https://mydeephavenserver.example.com:8000/iris/connection.json`
4. Enter your **UserId** and **Password** for your Deephaven server.
5. Click **Test Creds** to verify the connection.
6. Click **Set Credentials** to save.

![The Deephaven Excel Credentials Editor window](../../assets/how-to/excel/connect-plus.png)

You're now connected to Deephaven!

## Fetch data from Deephaven

The Excel client provides two functions to access Deephaven data:

### `DEEPHAVEN_SNAPSHOT`

Retrieves a single snapshot of table data at a specific point in time. Works on both static and ticking tables.

**Syntax:**

```
=DEEPHAVEN_SNAPSHOT(TABLE_DESCRIPTOR, FILTER_STRING, WANT_HEADERS)
```

**Parameters:**

- `TABLE_DESCRIPTOR`: `"<ConnectionID>:<PersistentQueryName>/<TableName>"` (e.g., `"con1+:pq1/my_table"`)
- `FILTER_STRING` (optional): Filter expression (e.g., ``"Symbol = `AAPL` && Quantity > 50"``)
- `WANT_HEADERS` (optional): `TRUE` to include column names, `FALSE` otherwise (default: `FALSE`)

**Example:**

First, create a Persistent Query called `test_pq` with a simple table:

```python order=static_table
from deephaven import empty_table

static_table = empty_table(10).update(formulas=["X = randomInt(0,10)"])
```

Then in Excel, use:

```
=DEEPHAVEN_SNAPSHOT("con1+:test_pq/static_table",,FALSE)
```

![`DEEPHAVEN_SNAPSHOT` retrieves a table from Deephaven](../../assets/how-to/excel/excel-snap-plus.gif)

### `DEEPHAVEN_SUBSCRIBE`

Subscribes to ticking table updates and automatically refreshes data as it changes on the server.

**Syntax:**

```
=DEEPHAVEN_SUBSCRIBE(TABLE_DESCRIPTOR, FILTER_STRING, WANT_HEADERS)
```

**Example:**

Create a Persistent Query called `test_pq` with a ticking table:

```python ticking-table order=null
from deephaven import time_table
import random


def rand_exchange() -> str:
    return random.choice(["kraken", "gemini", "bitstamp", "binance", "coinbase-pro"])


crypto_table = (
    time_table("PT1S")
    .update(
        [
            "Exchange = rand_exchange()",
            "Price = randomDouble(2000,4000)",
            "Size = randomDouble(0,4)",
        ]
    )
    .tail(10)
)
```

![The ticking `crypto_table` in the Deephaven console](../../assets/how-to/excel/crypto-table.gif)

In Excel, fetch the ticking table:

```
=DEEPHAVEN_SUBSCRIBE("con1+:test_pq/crypto_table",,FALSE)
```

![The `crypto_table` ticks in Excel after being retrieved with `DEEPHAVEN_SUBSCRIBE`](../../assets/how-to/excel/subscribe-crypto-plus.gif)

Cells that reference this data will automatically update when the source table changes. For example, multiply `Price` and `Size` using relative references:

![Two cells are multiplied together using their relative references](../../assets/how-to/excel/mult-relative-ref.gif)

> [!NOTE]
> For ticking data, expect Excel to update your sheet every few seconds.

## Use Excel formulas with Deephaven data

Once you have Deephaven data in Excel, you can use standard Excel functions. For example:

**Use `INDEX` and dynamic array references:**

![`INDEX` and dynamic array references are used to multiply two specific columns together](../../assets/how-to/excel/inline-index.gif)

**Filter with `FILTER`:**

![An entire table is filtered with `FILTER`](../../assets/how-to/excel/filter-whole-table.gif)

With the Deephaven Excel client, you have the full power of Excel to analyze, visualize, and transform your real-time data.

## Related documentation

- [Excel client reference guide](../../clients/excel-client.md)
- [Create a Persistent Query](../../query-management/ui-queries.md)
- [Develop a Python client query](../develop-client-query/develop-python-query.md)
