Analyse & refresh BigQuery data in Google Sheets using Connected Sheets

You can use functions, charts, extracts, pivot tables and refresh BigQuery data in Google Sheets. 

Important: To access BigQuery data in Google Sheets, you need access to BigQuery and an Enterprise Plus, G Suite Enterprise for Education, Enterprise Standard or Enterprise Essentials account. Learn how to get started with BigQuery.

  1. On your computer, open a spreadsheet in Google Sheets that is connected to BigQuery data.
  2. At the top, click Chart.
  3. Choose where to place it.
  4. Click Create.
  5. At the right, choose your other settings.
  6. At the bottom right, click Apply.

Learn more about charts in Google Sheets.

Tip: To update the chart based on the latest BigQuery data, at the bottom of the chart, click Refresh.

Add a pivot table
  1. On your computer, open a spreadsheet in Google Sheets that is connected to BigQuery data.
  2. At the top, click Pivot table.
  3. Choose where to place it.
  4. Click Create.
  5. At the right, choose your settings.
  6. At the bottom right, click Apply.

Tips

  • Pivot tables can currently support up to 30,000 results.
  • To limit the amount of data you see in your pivot table, specify the number of rows or columns to return. Update 'sort by' and 'order' to specify which rows or columns are returned. 
  • To add calculated fields with a SUM or custom formula, in the side panel, next to 'Values', click Add and then Calculated field. Learn how to add Calculated fields in pivot tables.
  • To update to the latest BigQuery data, at the bottom of the pivot table, click Refresh.
  • To view values at intervals within a range, use histogram grouping. Values that are higher than the maximum and lower than the minimum are grouped together.
Use a function

You can use some functions with BigQuery data.

  1. On your computer, open a spreadsheet in Google Sheets that is connected to BigQuery data.
  2. At the top, click Function.
  3. Choose a function from the list.
  4. Select where to place the function.
  5. Click Create.
  6. Choose your reference column and add any other required parameters.
  7. Press Enter.
  8. Hover your mouse over a cell that contains the formula, and click Apply changes.


Tip: You can also type functions inside any cell. 

Pull data into an extract

You can analyse data offline or reference individual values and ranges within functions. You can pull up to 25,000 rows or 10 MB of your BigQuery data. If you try to pull more than this limit, only the first 25,000 rows will appear. 

  1. On your computer, open a spreadsheet in Google Sheets that is connected to BigQuery data.
  2. At the top, click Extract.
  3. Choose where to put it.
  4. Click Create.
  5. At the right, under 'Extract editor', add columns, filters and sort settings.
  6. At the bottom left of the extract, click Apply changes.
Add a calculation to all rows in a data set
  1. On your computer, open a spreadsheet in Google Sheets that is connected to BigQuery data.
  2. At the top, click Calculated column.
  3. Enter a formula using column names and supported Sheets functions. You can use basic math operations like =price * quantity or manipulate text with =RIGHT(orderId, 4)
  4. Click Add.

Tip: To apply a calculation to all rows, add a calculated column.

Supported functions
Logic functions
  • IF (can be used to detect potential errors, such as division by zero)
  • AND
  • OR
  • NOT
Text functions
  • LEFT, RIGHT, MID
  • UPPER, LOWER
  • LEN
  • CONCAT (&)
Basic maths
  • +, -, *, /
  • The negative sign (-) and the percentage sign (%)

Maths functions

  • ROUND
  • POW/POWER (^)
  • SQRT
  • ABS
  • LOG, LN, LOG10

Dates and times

  • DATE, TIME
  • YEAR, MONTH, DAY
  • HOUR, MINUTE, SECOND
Comparison
  • =, <>
  • >, >=, <, <=
Aggregations
  • SUM
  • SUMIF
  • SUMIFS
  • COUNT
  • COUNTIF
  • COUNTIFS
  • COUNTUNIQUE
  • COUNTUNIQUEIFS
  • MIN
  • MINIFS
  • MAX
  • MAXIFS
  • AVERAGE
  • AVERAGEIF
  • AVERAGEIFS
  • VAR
  • VARP
  • STDEV
  • STDEVP

Other

  • ISBLANK (returns whether or not the given argument is NULL)

Refresh your data

BigQuery data doesn't automatically sync with Connected Sheets. To sync the data, you can refresh a specific item, everything within a data source or everything within all data sources. Once you’ve connected to a data source, you can refresh that data and all of the objects such as Charts, Functions, Extracts and Pivot Tables associated with that data. 
  1. On your computer, open a spreadsheet in Google Sheets that is connected to BigQuery data.
  2. At the bottom, next to 'Refresh', click More More and then Refresh options.
  3. To the right, under 'Refresh options', click the items you want to refresh. To refresh all of the data, at the bottom right, click Refresh all.
Schedule a refresh
A scheduled refresh will update all objects and data sources at a specific, preset time.
Important:
  • A scheduled refresh will run as the user that set up the schedule. If another user adds or updates an existing data source, the schedule will automatically pause. To unpause, contact the schedule owner or take over the refresh.
  • Objects in the preview or failed state will not be refreshed with a scheduled refresh. 
  1. On your computer, open a spreadsheet in Google Sheets that is connected to BigQuery data.
  2. At the bottom, next to 'Refresh', click More More and then Refresh options.
  3. At the bottom of the sidebar to the right, under 'Scheduled refresh', click Set up now.
  4. Choose your refresh frequency.
  5. Click Save
Take over a scheduled refresh

To run a scheduled refresh as yourself instead of the original owner, you can take over a refresh. 

  1. On your computer, open a spreadsheet in Google Sheets that is connected to BigQuery data.
  2. At the bottom, next to 'Refresh', click More More and then Refresh options.
  3. At the bottom of the sidebar to the right, under 'Scheduled refresh', click Edit.
  4. Choose your refresh frequency. 
  5. Click Save to transfer the scheduled refresh ownership to you.
     

Next: Write & edit a query with BigQuery data in Sheets

Related articles

Was this helpful?
How can we improve it?