When working with teams or automating workflows in the cloud, it's often necessary to convert Microsoft Excel files (.xlsx) into Google Sheets format. While you can do this manually by uploading files to Google Drive and opening them with Google Sheets, a more scalable and automated solution is to use Google Apps Script. This allows you to programmatically upload and convert Excel files, ideal for business workflows, scheduled tasks, or integrations.
In this detailed blog post, we’ll walk through:
Why convert Excel to Google Sheets
Step-by-step Apps Script to automate conversion
Upload via Drive and convert automatically
Handling folders and multiple files
Scheduling with Triggers
Google Sheets is a cloud-native spreadsheet app that allows real-time collaboration, seamless sharing, and integration with Google Workspace tools. Some reasons to convert Excel to Sheets:
Work in the cloud without Excel dependencies
Enable team collaboration in real-time
Use powerful features like Apps Script, Google Forms, and add-ons
Automate data processing or reporting in Sheets
Manual conversion is fine occasionally, but if you're working with many Excel files (from email, Drive uploads, API, or local automation), it’s better to automate.
Go to Google Apps Script
Click on "New Project"
Give your project a meaningful name like "Excel to Sheets Converter"
Here's the full script that does the following:
Looks in a specific folder in Google Drive
Detects .xlsx files
Converts each file to Google Sheets format
Saves it in a destination folder
To use Drive.Files.insert, you must enable the Advanced Drive API:
Click on "Services" (left panel in Apps Script editor)
Click "+" to add a service
Search for Drive API and add it
To find the folder IDs:
Open the Google Drive folder
Copy the URL. The string after /folders/ is your Folder ID.
Example:
Here, 1A2B3C4D5E6F is the folder ID.
Set the folder with Excel files as the sourceFolderId, and where you want the Google Sheets to go as the destinationFolderId.
Click the Run ▶️ button. Authorize the script the first time it runs. Then it will begin processing Excel files in the source folder and save the converted Google Sheets versions into the destination folder.
You can view logs under View > Logs to see the status.
To automate this process daily or hourly:
Go to Triggers (left-side clock icon)
Click "+ Add Trigger"
Choose convertExcelFilesToGoogleSheets as the function
Choose time-based (e.g., every day, hour, or custom frequency)
This will run the script automatically and check the folder for any new Excel files to convert.
If you want to clean up the folder by deleting Excel files after converting:
Place this line right after the Drive.Files.insert() call.
Be careful! Once trashed, files are not easily recoverable.
Client Submissions: Clients email Excel reports that get uploaded to Drive, converted, and inserted into a dashboard.
Form Responses: Exported Excel files from third-party apps are automatically added to Sheets.
Backups: Automatically archive converted data in Sheets format.
Data Pipelines: Convert Excel before running Apps Script data processing.
File format issues: Only .xlsx format is reliably supported.
File too large: Google Sheets has row/column/cell limits.
Quota limits: Google Apps Script and Drive APIs have daily quotas. Use QuotaLimits class to check usage.
Conversion failed: Add error handling using try...catch blocks to gracefully skip files that cause issues.
Automating Excel to Google Sheets conversion using Apps Script saves time, ensures consistency, and integrates well with Google Workspace workflows. Whether you are a developer, data analyst, or business owner, setting this up can simplify many repetitive tasks.
This script is highly customizable — you can filter by file name, send email notifications after conversion, or even process data in the converted Sheets.
Start with the base script provided and build on it as per your business logic!