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

  1. Open any Google Sheet.
  2. Select Extensions → Add-ons → Get add-ons.
  3. Search for Ternary and select Install.
  4. Approve the requested Google permissions.

You can also install from the Google Workspace Marketplace.

Create an API key

  1. In Ternary, open the account menu in the top right.
  2. Select Settings → API Keys.
  3. Select Add API Key and copy the key.
🚧

API keys expire

An API key lasts up to 90 days, or less if you set a shorter expiry. When the key expires, formulas return TERNARY_AUTH_REQUIRED and 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

  1. Open the sidebar.
  2. 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.
  3. 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 spreadsheet

The 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

  1. Select the cell where the report should start. [TBD: confirm placement at the selected cell]
  2. In the sidebar, open the Build tab.
  3. 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_REPORT returns 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.

FunctionReturns
TERNARY_QUERYCost for a period, optionally narrowed to one dimension value.
TERNARY_QUERY_TABLEA breakdown of a dimension over a period, largest first, with a header row.
TERNARY_REPORTOne 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?)
ArgumentDescription
dimensionThe dimension to filter by. Defaults to the sheet's primary dimension.
dimensionValueThe value to narrow to. Leave empty for the period total. Pass a range to get one result per cell.
periodThe time period. See Period values.
measureThe 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?)
ArgumentDescription
periodThe time period. Note that period comes first in this function.
dimensionThe dimension to break down by. Each value becomes a row. [TBD: confirm it defaults to the primary dimension]
measureThe measure to total for each value. Defaults to billed cost.
rawHeadersTRUE 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?)
ArgumentDescription
reportIDThe report's ID, which is the UUID in the report's URL in Ternary.
rawHeadersTRUE to show field names as column headers instead of display names.
titleRowWhether 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

FormatExamplePeriod
Year2026Calendar year
Month2026-07One month
Quarter2026-Q3One quarter
MTDMTDMonth to date
YTDYTDYear to date
LAST_MONTHLAST_MONTHThe previous full month
LAST_N_MONTHSLAST_6_MONTHSThe previous N months, where N is 1 to 36
Custom range2026-07-01..2026-07-15A 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.

ErrorWhat it meansWhat to do
TERNARY_AUTH_REQUIREDNo valid API key is connected. The key may have expired, or someone disconnected the sheet.Create a new key and reconnect.
TERNARY_UNKNOWN_FIELDA 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-onTernary MCP
Best forBudget models, variance analyses, board materialsExploring questions in plain language
OutputComplete report in cellsAn answer in your AI assistant
ConsistencyIdentical for every user, refreshable on demandVaries with how you phrase the question
AuthenticationAPI key stored with the spreadsheetOAuth 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.


Did this page help you?