Google BigQuery (GBQ) doesn’t require additional maintenance costs and processes your data in less than a minute. You can learn about uploading data to GBQ from CSV file and JSON files, using the BigQuery API, Google Analytics 4, or from other Google services in our previous article.
You can also learn more about setting up the OWOX BI BigQuery Reports Add-on and automating reports in Google Sheets based on information from BigQuery. Today, we’ll tell you how to upload data from BigQuery to your all-time favorite – Excel.
To learn more about the benefits and ease of use of Google’s cloud-based data storage, read our detailed overview of BigQuery features. You can also watch the video “What is BigQuery?” by DevBytes, and read about five reasons why building reports is better in BigQuery
Note:* This post was originally published in February 2020 and was completely updated in April 2025 for accuracy and comprehensiveness.*
BigQuery, developed by Google, is a cloud-based platform for big data analytics, specifically designed for large-scale enterprises. It enables the swift querying of vast datasets, often comprising thousands of rows, thanks to its powerful processing capabilities. By integrating BigQuery with your applications, you gain the ability to ingest and analyze extensive data volumes in real time, facilitating up-to-the-minute insights for business initiatives.
BigQuery can handle large datasets efficiently, allowing users to push data into a specified BigQuery dataset. This integration enables data professionals to leverage BigQuery's cloud capabilities while using familiar interfaces like Excel for easier management and analysis.
Signing up for an account grants access to BigQuery’sfeatures, with the option of a monthly flat-rate payment plan. This plan offers businesses a predetermined data import and querying capacity, supporting multiple concurrent project analyzes.
Connecting BigQuery to Microsoft Excel opens up enhanced capabilities for businesses by leveraging Excel’s robust data analytics and visualization tools alongside BigQuery’s scalable cloud data warehouse for handling vast datasets in real time. This integration offers several key benefits:
Additionally, this integration provides advanced data manipulation capabilities and advanced functionality, such as performing a Distinct Count and utilizing Power Pivot Measures, which are critical for users needing flexibility during data integration and enhancing their analytics processes. When you connect BigQuery to Excel, it becomes easier to use these advanced features for more powerful and flexible analysis.
This synergy not only amplifies data handling efficiency but also enriches the analytical outcomes available to businesses, making it a strategic move for leveraging data-driven insights.
There are several methods available to establish this connection, each tailored to meet different needs and technical requirements. From utilizing Power Query – a feature within Excel that simplifies data import and transformation – to leveraging Directly Import data from BigQuery to Excel Using IQY file for a more direct data import, the choice of method depends on factors such as the need for real-time data updates, ease of setup, and specific project requirements.
This involves saving Excel data as CSV, uploading it through the BigQuery Web UI, and noting the manual nature and lack of automation for recurring data transfers. Saving your data as a CSV file ensures compatibility and smooth uploading into BigQuery datasets.
If necessary, you can always create a new key.
You can also expire your current key using the Revoke Key button or in your Google profile settings.
Note that if your query exceeds 256 characters, Excel won’t run it. In this case, you should split your query into parts and insert them into adjacent cells.
It’s ready! Your BigQuery data will now appear in Excel. The Import Data window provides options for transforming and managing data, including row limits for various data sources and the ability to add data to the Data Model for enhanced functionality.
As an alternative way to connect to Excel, you can use the Magnitude Simba ODBC driver for BigQuery, which is explained below. Detailed instructions can be found on YouTube: How to Connect Google BigQuery to Microsoft Excel. When using Power Query, you can rename datasets for clarity.
Connecting BigQuery to Excel using the API involves a technical process that leverages BigQuery’s REST APIs to automate data sync and integration with external applications, necessitating a good grasp of programming and API usage. Given its technical nature, this method is best suited for those with engineering or analytical expertise, offering a powerful way to leverage their skills for advanced data integration tasks.
To get started, you need to enable the BigQuery API and install the BigQuery API client library as part of the setup process. Additionally, users must create a service account to connect BigQuery to external applications via API. Here’s how to establish this connection:
2. Create a service account in Google Cloud Platform by going to ‘IAM & Admin’ > ‘Service Accounts’ in your GCP console. Fill in the necessary details for the account and assign it a role with permissions for BigQuery, such as the BigQuery Data Viewer role or BigQuery Data Editor role, to ensure it has the required access. During this setup, you will need to enter service account details to grant appropriate access roles for the project.
Here's a simplified Python code example for fetching data from BigQuery and exporting it to Excel:
from google.cloud import bigquery
import pandas as pd
from io import BytesIO
# Authenticate using the service account JSON key
client = bigquery.Client.from_service_account_json('path/to/your_service_account.json')
# Configure the job to export data in CSV format
job_config = bigquery.ExtractJobConfig()
job_config.destination_format = 'CSV'
job_config.print_header = False
# Specify your GCS bucket and file path
bucket_name = 'your-bucket-name'
destination_uri = f'gs://{bucket_name}/your-data.csv'
# Reference your BigQuery table
table_ref = client.dataset('your_dataset').table('your_table')
# Initiate the export job
extract_job = client.extract_table(table_ref, destination_uri, job_config=job_config)
# Assuming the CSV file is now in your GCS bucket, download and convert it to a DataFrame
bucket = client.get_bucket(bucket_name)
blob = bucket.blob('your-data.csv')
csv_string = blob.download_as_string()
df = pd.read_csv(BytesIO(csv_string))
# Export the DataFrame to an Excel file
df.to_excel('your-data.xlsx')
This code snippet outlines fetching data from BigQuery, converting it to a CSV format, downloading it, and then exporting it to Excel. Modify the code according to your specific requirements. For comprehensive information, consult the BigQuery REST API documentation.
Power Query Editor enhances Excel by enabling connections to various external data sources, a capability seamlessly integrated into Excel under the "Get & Transform Data" section in the Data tab. Excel can import data from BigQuery using a custom SQL query when combined with Power Query.
For this example, we'll utilize the ODBC driver as a BigQuery Excel connector, one of the options supported by Excel's Get Data feature, to connect to BigQuery. Using the ODBC driver, users can connect BigQuery to Excel without extensive coding knowledge.
First, we need to determine the Excel version (32-bit or 64-bit) before installing the driver.
To connect your BigQuery account to Excel, first, ensure you download and install the most recent version of the Google BigQuery ODBC driver on your system.
2.1 If you use 32-bit Excel, download the Windows 32-bit driver.
2.2 If you use 64-bit Excel, download the Windows 64-bit driver.
3. Fill in your details (name, email, etc.), then click DOWNLOAD.
4. Extract the contents of the downloaded .zip file to a temporary directory.
5. Run the installer:
5.1 For 32-bit Excel: PROGRESS_DATADIRECT_ODBC_8.0_WIN_32_INSTALL.exe
5.2 For 64-bit Excel: PROGRESS_DATADIRECT_ODBC_8.0_WIN_64_INSTALL.exe
6. Follow the on-screen prompts to complete the installation.
After installation, follow the steps below to establish a connection with your BigQuery account.
1. Open the ODBC Data Sources app by searching for "ODBC" in the start menu search bar.
2. Within the app, navigate to the System DSN tab, select "Google BigQuery," and click on the "Configure" button.
4. Authenticate access by logging into your Google account and allowing the connection when prompted.
5. After successful authentication, a success message will appear in your browser. Close the browser and return to the DSN configuration window, where the Refresh Token should now appear.
After setting up the ODBC driver as a BigQuery connector for Excel on your system, you're ready to utilize it as a data source for exporting data from BigQuery into Excel. Begin by opening a new Excel worksheet, and then proceed with the following steps to establish a connection between BigQuery and Excel.
Here's how you can load the data from BigQuery to Excel:
You've now adeptly navigated the process of connecting BigQuery to Excel via ODBC and have successfully imported your data into Excel.
Automatically updating data from BigQuery in Excel is a powerful feature that ensures your analysis is always based on the most current information, leveraging advanced data manipulation capabilities. After you have successfully imported data from BigQuery into Excel, it’s crucial to maintain the freshness of this data to reflect any changes or updates that occur in the BigQuery database.
To utilize the auto-refresh feature for data updates, it is important to keep the Excel window open.
Excel facilitates this through its ability to connect to external sources and refresh data both manually and automatically. Manual refreshes are useful for ad-hoc updates, while automatic refreshes are ideal for maintaining up-to-date data without constant manual oversight. Setting up automatic data refreshes can save significant time and effort, allowing you to focus on analysis rather than data management.
This feature is especially beneficial in dynamic environments where data changes frequently, ensuring that your Excel workbook reflects the latest data with minimal effort. After importing data from BigQuery into Excel, it is crucial to ensure that the data remains up-to-date.
Manually refreshing data in Excel involves a simple process to ensure your workbook contains the latest information from BigQuery. Navigate to the Data tab and locate the refresh icon positioned above the “Refresh All” option within the “Queries & Connections” section.
Accessing the raw data is crucial for comprehensive analysis and reporting, especially when dealing with configurations that handle data limits and transformations between platforms.
Clicking this icon initiates an immediate data update. Alternatively, for a quicker method, you can utilize the shortcut key Alt + F5. This action forces Excel to fetch and update the imported data, ensuring your analysis is based on the most current dataset available.
For continuous data updates without manual intervention, Excel allows you to set up automatic data refresh at specified intervals. Here’s how you can activate this feature:
3. Click “OK” to apply and save your settings.
It is also essential to clearly label the source data in Power Query to enhance transparency and facilitate a deeper understanding when sharing analyses with stakeholders.
With these steps, Excel will automatically refresh and update the BigQuery data at the intervals you’ve set, ensuring your data analysis remains up-to-date without needing manual refreshes in the import data window. This helps that your Excel file always reflects the latest BigQuery updates without manual intervention.
When you connect BigQuery to Excel, following proper data management practices is essential to maintain data quality and performance. To ensure effective data management, it’s essential to follow best practices when working with BigQuery and Excel.
By following these best practices, you can ensure effective data management and analysis when working with BigQuery and Excel.
Now you know how to load data from Google BigQuery cloud storage to Excel.
And if you want to learn more about GBQ and other analytics tools, subscribe to our newsletter. Every month you’ll get useful tips for modern marketers and analysts.
Connecting BigQuery to Excel combines the scalable data warehouse capabilities of BigQuery with Excel's powerful data analysis and visualization tools. Benefits include seamless access to large datasets, advanced data analysis, improved collaboration through Excel's user-friendly format, streamlined data reporting, and expanded integration options with other Google services.
To manually refresh data, go to the Data tab in Excel, locate the refresh icon above the "Refresh All" button within the "Queries & Connections" section, and click it. Alternatively, you can use the shortcut key Alt + F5 to initiate a data refresh, ensuring your workbook is updated with the latest data from BigQuery.
Yes, Excel can automatically refresh data at specified intervals. To set this up, navigate to Data > Queries & Connections > Refresh All, then click on "Connection Properties" at the end. In the Query Properties menu, select the "Refresh every" option, enter your desired interval in minutes, and click "OK" to save.
Several methods are available, including using Power Query within Excel, directly importing data using an IQY file, leveraging the Magnitude Simba ODBC driver for BigQuery, or connecting through BigQuery's API for a more technical approach. Each method has its own setup and operational requirements.
Using an API to connect BigQuery to Excel is more technical and offers a powerful way to automate data integration tasks, requiring programming knowledge. Power Query provides a more user-friendly, graphical interface to import and transform data, making it accessible without extensive programming skills.
Prerequisites include having a Google Cloud Platform account with BigQuery set up, access to the BigQuery dataset you wish to import, and depending on the method, the necessary ODBC driver or API credentials. Additionally, you need Excel installed on your computer, with Power Query available for Excel 2016 and later versions.