Sub topic 6
Opening and converting Excel workbooks
This chapter assumes you can upload files to Google Drive and move around a spreadsheet. It also assumes you know what an Excel workbook is, meaning an .xlsx or .xls file with one or more sheets, and that you can use basic formulas such as TRIM and TEXT. The previous chapters covered the File > Import dialog and its location options. This chapter covers what is different when the source is an Excel workbook, and what can change when Sheets converts it.
Three routes for an Excel file
An Excel workbook is not a plain text file. It stores several sheets, formulas, formatting, charts, and sometimes macros. A CSV import only parses text, but an Excel import has to translate all of that. Google Sheets offers three routes, and they behave differently.
| Route | How you start it | Result | Original file |
|---|---|---|---|
| Office editing mode | Double-click the file in Drive, or open it with Google Sheets | The file stays an `.xlsx` and you edit it in place | Changed when you edit |
| Save as Google Sheets | From Office editing mode, choose File > Save as Google Sheets | A new native Google Sheets file | Untouched |
| File > Import | In an open Sheets file, choose File > Import and pick the workbook | Data is placed in the file you have open | Untouched |
Pick the route by asking who needs the file afterward. Choose Office editing mode if the workbook must stay an Excel file, for example because colleagues use Excel and expect macros. Choose Save as Google Sheets if you want to work in Sheets with features such as IMPORTRANGE, Apps Script, or comments. Choose File > Import if the workbook's data belongs inside an existing Sheets file, or if you want to control where it lands.
Office editing mode
When you double-click an .xlsx file in Drive, Sheets opens it in Office editing mode. You can recognize it by the .XLSX badge next to the file name. Sheets does not convert the file here. It edits the Excel file directly and saves changes back in Excel format.
This mode is useful for a quick look or a small edit. It also shows you what Sheets can and cannot represent, because features Sheets does not support are dropped from the display. Treat that as a warning. If you keep editing and saving in this mode, the unsupported parts may be lost from the stored file too. Keep a backup copy of any workbook with macros or complex features before you edit it this way.
Some Sheets-only features are unavailable in this mode, including Apps Script and IMPORTRANGE. If you need them, convert the file.
Converting with Save as Google Sheets
From Office editing mode, choose File > Save as Google Sheets. Sheets creates a new native spreadsheet in the same Drive folder and opens it. The .xlsx file stays as it was, so you now have two independent files. Changes in one do not reach the other.
Conversion has these effects:
- Every sheet in the workbook becomes a tab.
- Excel formulas are translated to Sheets formulas and recalculated.
- Number formats, fonts, colors, merged cells, frozen panes, and column widths are carried over where Sheets has an equivalent.
- Named ranges, data validation rules, and conditional formatting are converted. Complex rules may be simplified.
- Anything with no Sheets equivalent is dropped or flattened.
The converted file is a copy. If the workbook keeps changing in Excel, you will have to convert it again, or import it again with a location option that replaces data. Editing the converted copy does not update the original.
Importing with File > Import
You can also import a workbook from inside a Sheets file with File > Import > Upload (or by choosing it from Drive). The dialog offers the same import locations as for CSV files, but two things are different for Excel.
First, the separator type and the "Convert text to numbers, dates, and formulas" option do not apply. They exist for delimited text. An Excel file already stores numbers, dates, and formulas as typed values, so Sheets reads them directly.
Second, a workbook has several sheets, and the location option decides what happens to them. "Create new spreadsheet" and "Insert new sheet(s)" bring each workbook sheet in as its own tab, and you can see them all. The options that write into one place, such as "Replace current sheet", "Append to current sheet", and "Replace data at selected cell", are built around a single block of data. After using one of them, check whether all your workbook sheets arrived or only one did. Do not assume.
When in doubt, use "Insert new sheet(s)". It never touches existing tabs, so a bad import costs you only a few tabs to delete.
What may change during conversion
Most plain workbooks convert cleanly. Workbooks built for heavy Excel use are where surprises appear. Review these areas.
| Excel feature | What may happen in Sheets |
|---|---|
| VBA macros | Not carried over. Sheets cannot run VBA. You must rewrite the logic in Apps Script |
| Excel-only functions | The cell may show `#NAME?` or an error instead of a value |
| Power Query, data model, Power Pivot | Not supported. The loaded data may remain as static values |
| Charts | Converted, but styling, axis settings, or less common chart types may differ |
| Pivot tables | Usually converted, but grouping and calculated fields may differ |
| Slicers and timelines | May be dropped or replaced |
| Excel Tables (structured references) | May become plain ranges. Formulas that used table names may need rewriting |
| Fonts not available in Sheets | Replaced by a similar font, which can change column fit |
| External workbook links | Usually cannot refresh. You may see stale values or errors |
| Password-protected files | Cannot be imported until the password is removed |
Size limits also apply. A very large workbook can fail to convert, and a Sheets file has a cap on total cells. Check Google's current documentation for the exact figures, because they change over time.
One more difference matters for dates and calculations. Excel and Sheets both store dates as serial numbers, and Sheets converts the numbers correctly for modern dates. Problems usually come from the display format or the locale (see the next chapter), not the stored number.
Verifying a converted workbook
Never trust a conversion because it looks right at first glance. Do three checks.
First, count errors. This formula returns how many cells in the range hold an error value. Change the range to cover the tab you are checking.
=SUMPRODUCT(--ISERROR(A1:Z1000))A result of 0 means no cell in that range shows an error. A nonzero result means you should scan for #NAME?, #REF!, and #VALUE!. Use Edit > Find and replace with the search text # set to search within formulas and values to jump between them, or sort a helper column.
Second, compare totals. Pick a few key totals in the original Excel file, such as a column sum or a row count, and compare them with the same calculation in Sheets. A match on three or four independent figures gives good confidence. A mismatch tells you where to look.
Third, check formulas that matter. Click on a few converted formulas and read them in the formula bar. Look for functions Sheets rewrote, and for references that point to a sheet or range that no longer exists.
Converting with Apps Script
If you convert many workbooks, you can do it with a script. This function uses the Advanced Drive Service, which you must enable first. In the Apps Script editor, open Services, add Drive API, and choose version v3. The function reads an .xlsx file from Drive and creates a converted Google Sheets file.
function convertXlsxToSheets() {
const fileId = 'YOUR_XLSX_FILE_ID';
const blob = DriveApp.getFileById(fileId).getBlob();
const resource = {
name: 'Converted workbook',
mimeType: MimeType.GOOGLE_SHEETS
};
const converted = Drive.Files.create(resource, blob);
Logger.log('Created: https://docs.google.com/spreadsheets/d/' + converted.id);
}Setting the target mimeType to Google Sheets is what asks Drive to convert the upload instead of storing it as an Excel file. The original file is left alone. The same limits and feature losses apply as with the manual route.
Common errors and fixes
- The file opens but edits do not appear in a Sheets-only feature. You are still in Office editing mode. Look for the
.XLSXbadge, then use File > Save as Google Sheets. #NAME?in converted cells. The function has no Sheets equivalent, or the name refers to something that did not convert, such as a table. Replace it with a Sheets function or a plain range reference.- Values differ from Excel. Compare the cell in both programs and read the formula. Check for cached values in Excel that were never recalculated.
- Only one sheet arrived. You probably used a single-sheet location option. Import again with "Insert new sheet(s)" or convert the file with Save as Google Sheets.
- The import fails or the file will not open. The file may be password-protected, damaged, or too large. Remove the password, re-save it in Excel, or split the workbook.
- A macro button does nothing. VBA does not run in Sheets. Rebuild the behavior in Apps Script.
Exercise
A colleague sends a workbook, report.xlsx, that has three sheets, a VBA macro, and a pivot table. You need to analyze the data in Google Sheets using IMPORTRANGE and share it with people who do not have Excel. Which route do you use, what do you do with the macro, and how do you check the result?
Show answer
Use Save as Google Sheets (open the file in Office editing mode first), because IMPORTRANGE needs a native Sheets file and the original must stay unchanged. Sheets cannot run VBA, so rewrite the macro's logic in Apps Script if you still need it. To check the result, confirm all three tabs exist, count errors with =SUMPRODUCT(--ISERROR(range)) on each tab, compare a few totals with the Excel file, and review the pivot table for differences in grouping or calculated fields.
Exercise
You use File > Import with "Replace current sheet" on a four-sheet workbook and find only one tab of data. What do you do next, and why is "Insert new sheet(s)" a safer first choice?
Show answer
Import again with "Insert new sheet(s)" (or convert with Save as Google Sheets) so that every workbook sheet becomes its own tab. It is safer because it never overwrites existing tabs, so a bad result only adds tabs that you can delete.