You cannot upload an .xlsx file straight into BigQuery, so the practical way to import Excel into Google Cloud is to convert the sheet to CSV, store it in a Cloud Storage bucket, then load it into BigQuery (or read it with Google Sheets-connected tools). The whole job takes about ten minutes once your project and billing are enabled. Below are the exact steps, plus the fixes for the problems that most often stop an import halfway.
What You'll Need
- A Google Cloud project with billing enabled (Cloud Storage and BigQuery both need it).
- The BigQuery API and Cloud Storage API enabled on that project; the console prompts you if they are not.
- Your Excel file cleaned up: a single header row, no merged cells, no blank rows mid-table, and no hidden columns you do not want loaded.
- Permission to create buckets and datasets, or a colleague who can do it (roles like Storage Admin and BigQuery Data Editor, or simpler, Project Editor for a test project).
- The Google Cloud CLI if you prefer the command line over the web console.
Note that menu labels can vary slightly by console version and region, so treat the paths below as a guide rather than a script.
Step-by-Step
- Clean the spreadsheet first. Delete title rows above your header, unmerge any merged cells, and make sure every column has a heading. Merged cells and multi-row headers are the single biggest cause of a load that fails or produces scrambled columns.
- Save as CSV. In Excel, choose File > Save As and pick CSV UTF-8 (comma delimited). If your file is large, save sheets one at a time so you know what is loading, and check any values with leading zeros or long numbers (postcodes, IDs) survived without Excel reformatting them.
- Open the Cloud Storage bucket you will use. In the Google Cloud console, go to the navigation menu and choose Cloud Storage > Buckets. Create a new bucket if needed, then click into it. Upload the CSV with the Upload files button (or Upload folder for several).
- Create or select a dataset in BigQuery. Open BigQuery in the console. Either pick an existing dataset or click the three-dot menu next to your project and choose Create dataset. Give it an ID and leave the default location, then click Create dataset.
- Start a load job. With the dataset selected, click Create table. Under Source, choose Google Cloud Storage as the source type and paste the gs:// path to your CSV from the bucket. Under File format, pick CSV.
- Set the destination. Name the table, confirm it is in the right project and dataset, and choose Native table as the table type. Choose whether to overwrite, append, or fail if the table already exists.
- Define the schema. Click Auto detect to let BigQuery infer field types, then review every column. Check that dates look like dates and numbers like numbers. You can also edit the schema manually to name types precisely.
- Fix the header row setting. Under Advanced options, set Header rows to skip to 1 if your CSV has a header. Without this, BigQuery tries to type the word "Date" as a date and the load fails.
- Run it and check the result. Click Create table and watch for a green check in the job history. Then preview the table and spot-check row counts and a couple of values against the spreadsheet.
- Automate it if it is recurring (optional). Skip saved queries and repeat steps 3 to 9 by scheduling the load in Cloud Storage, or upload the new CSV to the same bucket path and reload with Option: Append.
Common Mistakes
- Not skipping the header row. The job fails with a type conversion error because the first row cannot be cast to the column type.
- Merged cells or extra title rows. Columns shift one place left or right, so data lands in the wrong fields but nobody notices until a query returns nonsense.
- Excel auto-formatting. Long numbers turn into scientific notation or leading zeros disappear. Set those columns to Text inside Excel before re-saving.
- Wrong file encoding. Saving as plain CSV on Windows can mangle accented characters. Always use CSV UTF-8.
- Dates written in several formats. Mixed dd/mm/yyyy and mm/dd/yyyy in one column will fail or load incorrectly. Standardise before upload.
- Uploading to a bucket you cannot read back from. Check the bucket name and the full gs:// path matches exactly what you pasted.
Tips
- Avoid loading a 100 MB file if a 10 MB version does it. Split tabs into their own CSV files and load each into its own table.
- Load into a temporary table first, check the row count and a few values, then reload as Append once you are happy.
- If the sheet changes often and is smaller than 10 MB, uploading it to Google Drive as a sheet and using BigQuery with an external connection to Google Sheets is another route, though CSV upload is simpler for one-off jobs.
- Keep the naming consistent: date-stamped CSVs in the bucket make repeat loads easy to audit.
- Use a single header row, lower-case column names and no spaces; they become BigQuery field names and are easier to query.
Troubleshooting
- "Error while reading data, error message: Could not parse". Usually a header row that was not skipped, or a column with mixed types. Set Header rows to skip to 1, or force the column type to STRING in the schema.
- Column count mismatch. A stray comma or quote inside a text field broke the CSV structure. Open the CSV, fix the offending cell, and re-save as UTF-8.
- Permission denied on the bucket. You lack Storage Object Viewer or Creator on that bucket. Ask the project owner to grant it, or upload to a bucket you own.
- Billing not enabled. BigQuery and Cloud Storage will not accept jobs without an active billing account. Enable it in the console's Billing section.
- Load succeeded but data looks wrong. Preview the first rows and compare them to the spreadsheet. Wrong data usually means merged cells or column order shifted, not a BigQuery fault. Fix the source and reload with Append or Overwrite.
- Nothing seems to work. Check the Google Cloud status page, reload the console page, sign out and back in, and make sure the APIs are enabled on the same project as the bucket and dataset.
Frequently Asked Questions
Can I upload an .xlsx file directly?
Not as a natively loaded table in BigQuery. Convert to CSV first, or save it as a Google Sheet and use an external Google Sheets connection as a separate route.
What is the file size limit?
It varies by upload method and format. BigQuery's own limits apply to loads, and Cloud Storage has its own limits; check the current limits in the official docs before uploading very large files.
Do I need to enable billing?
Yes. BigQuery and Cloud Storage both require an active billing account on the project, even for small loads.
How do I load several sheets?
Save each sheet as its own CSV and repeat the upload and load, or combine them into one CSV if they share the same columns.
Can I update the table later?
Yes. Reload the new CSV and choose Append to add rows or Overwrite to replace the table contents.
Why did my leading zeros disappear?
Excel converted the value to a number. Set the column to Text in Excel, re-save as CSV UTF-8, and reload.