Google Sheets Add-on
Bring Ternary reports and live cost figures into Google Sheets.
Finance plans, forecasts, and reports live in spreadsheets. The Ternary add-on for Google Sheets brings your Ternary data into that workflow. You import complete reports as blocks or reference live figures in individual cells. You don't need to export a CSV or paste values.
What you can do
- Import any report. Bring a saved Ternary report into the open sheet as a block.
- Refresh in place. Update an imported report, and your surrounding formulas, notes, and formatting stay as you left them.
- Use Ternary data in your own formulas. Reference cost figures in individual cells, so numbers stay current through every forecast cycle and period close.
- Keep access scoped. The add-on reads only the spreadsheet it is open in. Your API key goes only to Ternary's API.
Before you begin
You need:
- A Ternary account in the US or EU region.
- A Ternary API key. See Create an API key.
- Edit access to the Google Sheet you want to connect.
Install the add-on
- Open any Google Sheet.
- Select Extensions → Add-ons → Get add-ons.
- Search for Ternary and select Install.
- Approve the requested Google permissions.
You can also install from the Google Workspace Marketplace.
Create an API key
- In Ternary, open the account menu in the top right.
- Select Settings → API Keys.
- Select Add API Key and copy the key.
API keys expireAn API key lasts up to 90 days, or less if you set a shorter expiry. When the key expires, formulas return
TERNARY_AUTH_REQUIREDand imported reports can't refresh. Create a new key and reconnect the spreadsheet before then. See Using the API.
Open the add-on
Select Extensions → Ternary → Open Ternary. The Ternary sidebar opens on the right. From the sidebar you can:
- Connect an API key and choose a region
- Choose a tenant
- Browse fields and their values
- Insert formulas, including example formulas for your tenant
- Import, refresh, and remove copies of reports
Connect your spreadsheet
- Open the sidebar.
- Under Region, select US or EU. Choose the region you sign in to. If you're not sure, use the Ternary US or Ternary EU links in the sidebar to check.
- Paste your API key and select Connect.
When the connection succeeds, the top of the sidebar shows Connected and your tenant name.
One key per spreadsheetThe key is stored with the spreadsheet, so every editor sees the same numbers. See Security.
Switch tenants
Open the Data tab and select Switch next to the tenant name, or use the tenant menu at the top of the sidebar.
Disconnect
Open the Data tab and select Disconnect. This removes the key for every editor of the spreadsheet. Data you already imported stays in the sheet as a static copy.
Import a report
- Select the cell where the report should start. [TBD: confirm placement at the selected cell]
- In the sidebar, open the Build tab.
- Search for a report under Pick a report to bring in, then select it.
The full report arrives as a static block of cells. It doesn't change until you refresh it. Imported reports are listed on the Data tab under Imported data.
If you don't have the report you need yet, create one in Ternary. You can also ask an assistant connected through Ternary MCP to build and save it for you.
Import or formula?Import a report when you need every row.
TERNARY_REPORTreturns only one page of rows, so use the sidebar import for larger reports.
Refresh or remove imported reports
On the Data tab, under Imported data:
- Refresh one report: Select refresh next to the report. Only the cells inside that block change.
- Refresh everything: Select the refresh icon next to Last refreshed.
- Remove a report: Select remove next to the report. [TBD: does this clear the cells or only stop tracking the block?]
Use Ternary formulas
The add-on adds three custom functions. Type =TERNARY in any cell to see them with autocomplete.
| Function | Returns |
|---|---|
TERNARY_QUERY | Cost for a period, optionally narrowed to one dimension value. |
TERNARY_QUERY_TABLE | A breakdown of a dimension over a period, largest first, with a header row. |
TERNARY_REPORT | One page of a saved report's rows. |
Arguments marked with ? are optional. To leave an optional argument out while still using a later one, enter "" in its place.
[TBD: when formulas fetch new data, e.g. on open, when arguments change, or on manual recalculation]
TERNARY_QUERY
=TERNARY_QUERY(dimension?, dimensionValue?, period, measure?)
| Argument | Description |
|---|---|
dimension | The dimension to filter by. Defaults to the sheet's primary dimension. |
dimensionValue | The value to narrow to. Leave empty for the period total. Pass a range to get one result per cell. |
period | The time period. See Period values. |
measure | The measure to return. Defaults to billed cost. |
Examples
Month-to-date cost for Google Cloud:
=TERNARY_QUERY("FOCUS_SPEC_FIELD/ProviderName", "Google Cloud", "MTD")
Total cost for July 2026 across all providers:
=TERNARY_QUERY("", "", "2026-07")
Last month's cost for each provider listed in A2:A5:
=TERNARY_QUERY("FOCUS_SPEC_FIELD/ProviderName", A2:A5, "LAST_MONTH")
TERNARY_QUERY_TABLE
=TERNARY_QUERY_TABLE(period, dimension?, measure?, rawHeaders?)
| Argument | Description |
|---|---|
period | The time period. Note that period comes first in this function. |
dimension | The dimension to break down by. Each value becomes a row. [TBD: confirm it defaults to the primary dimension] |
measure | The measure to total for each value. Defaults to billed cost. |
rawHeaders | TRUE to show field names as column headers instead of display names. [TBD: confirm default] |
The table spills down and to the right from the formula's cell, sorted largest first. Leave enough empty cells, or Sheets shows a #REF! error.
Example: quarter-to-date cost by provider.
=TERNARY_QUERY_TABLE("2026-Q3", "FOCUS_SPEC_FIELD/ProviderName")
TERNARY_REPORT
=TERNARY_REPORT(reportID, rawHeaders?, titleRow?)
| Argument | Description |
|---|---|
reportID | The report's ID, which is the UUID in the report's URL in Ternary. |
rawHeaders | TRUE to show field names as column headers instead of display names. |
titleRow | Whether to include a first row naming the report. [TBD: confirm default] |
Returns one page of the report's rows. [TBD: page size] For larger reports, use Import a report.
Period values
| Format | Example | Period |
|---|---|---|
| Year | 2026 | Calendar year |
| Month | 2026-07 | One month |
| Quarter | 2026-Q3 | One quarter |
MTD | MTD | Month to date |
YTD | YTD | Year to date |
LAST_MONTH | LAST_MONTH | The previous full month |
LAST_N_MONTHS | LAST_6_MONTHS | The previous N months, where N is 1 to 36 |
| Custom range | 2026-07-01..2026-07-15 | A start and end date |
Find field names and values
In the sidebar, browse the fields available in your tenant and the values for each. Insert a field directly into a formula instead of typing it. [TBD: exact sidebar location]
Advanced menu
Extensions → Ternary → Advanced offers prompt-based alternatives to the sidebar. Use them if the sidebar doesn't load.
- Set the API key
- Set the tenant
- Set the primary dimension
- Set the API base URL
- Show configuration
Most users never need to set the API base URL. Choosing a region sets it for you.
Troubleshooting
Errors appear in the cell as codes.
| Error | What it means | What to do |
|---|---|---|
TERNARY_AUTH_REQUIRED | No valid API key is connected. The key may have expired, or someone disconnected the sheet. | Create a new key and reconnect. |
TERNARY_UNKNOWN_FIELD | A dimension or measure name isn't recognized. | Check the spelling, or insert the field from the sidebar. |
#REF! | A table can't spill because cells are in the way. | Clear the cells below and to the right of the formula. |
Security
- The add-on reads and writes only the spreadsheet it is open in.
- Your API key is sent only to Ternary's API for the region you selected.
- The key is stored with the spreadsheet. Anyone who can edit the spreadsheet can retrieve data with it. Share the spreadsheet with the same care you'd use for the key.
- When someone disconnects, the key is removed for every editor. Imported data stays in the sheet.
Add-on or MCP?
Both use the same Ternary data. They send it to different places.
| Google Sheets add-on | Ternary MCP | |
|---|---|---|
| Best for | Budget models, variance analyses, board materials | Exploring questions in plain language |
| Output | Complete report in cells | An answer in your AI assistant |
| Consistency | Identical for every user, refreshable on demand | Varies with how you phrase the question |
| Authentication | API key stored with the spreadsheet | OAuth sign-in for each user |
They work well together. Use Ternary MCP to build and save a report, then import it with the add-on for complete, audit-ready numbers.
Updated about 10 hours ago
