Sub topic 12
Limits and troubleshooting failed imports
Assume you can open a Google Sheet, upload files to Drive, and use basic formulas such as TRIM and TEXT. This chapter focuses on diagnosing an import that fails, stops early, or produces incorrect values.
An import problem usually belongs to one of four areas:
- The file is too large or exceeds a Sheets limit.
- The file structure is invalid or different from what you expected.
- Characters, separators, or locale settings are misread.
- The import succeeds, but Sheets converts values into the wrong types.
Start by identifying where the failure occurs
First, make a copy of the spreadsheet and keep the original file unchanged. Then test the smallest useful version of the data. For example, copy the header and 20 data rows into a new CSV file and import that file.
The result tells you where to look:
| Result | Likely cause | Next check |
|---|---|---|
| The import dialog rejects the file | Unsupported format, damaged file, or permission problem | File extension, file opening, and Drive access |
| Only some rows appear | Spreadsheet size limit, malformed row, or import timeout | Row lengths, file size, and the first missing row |
| Characters look wrong | Encoding mismatch | UTF-8 export and encoding option |
| Values change meaning | Locale or type conversion | Separators, dates, formulas, and leading zeros |
If the small file works, compare it with the full file. The problem is probably related to size, a particular row, or a special character.
Check file and spreadsheet limits
Google Sheets has limits on spreadsheet size, cells, formulas, and processing time. The exact limits can change, so treat a message from Sheets as more reliable than an old limit remembered from documentation.
Large imports can fail even when the source file opens correctly in another program. A CSV file is plain text, but Sheets must parse every field and store every value as a cell. A wide file with thousands of columns can use the same capacity quickly as a tall file with thousands of rows.
Reduce the import size when necessary:
- Remove unused columns and rows from the source file.
- Import separate files into separate spreadsheets.
- Split a large CSV into smaller files with the same header.
- Import raw data first, then create summaries in another sheet.
- Avoid importing repeated formatting or unnecessary formulas.
Do not solve a size problem by deleting random rows. Record which rows belong to each part so that you can combine or audit the results later.
Find malformed CSV rows
A CSV file is a sequence of records and fields separated by delimiters. A comma inside a field must be enclosed in quotation marks. Quotation marks inside a quoted field usually need escaping according to the CSV writer's rules.
For example, this row has one field containing a comma:
1001,"North Harbor, Building 2",OpenIf the quote is missing, Sheets may place later values in the wrong columns. One broken row can also make an import stop or shift the apparent error to a later row.
Check these details:
- Every row has the expected number of fields.
- Quoted fields have matching quotation marks.
- The delimiter is consistent throughout the file.
- Line breaks inside quoted fields are intentional.
- The first row is really a header, if you selected a header option.
When possible, export the CSV again from the source system instead of repairing it manually. A text editor can help locate the first broken line, but spreadsheet applications may silently change delimiters or formatting while opening the file.
> callout warning > Never diagnose a CSV by counting commas alone. A comma inside a quoted field is data, not a separator.
Fix encoding, locale, and type conversion
Garbled characters such as München usually indicate that the file was written in one character encoding and read as another. Export the source as UTF-8 when possible. If the source uses a different encoding, select that encoding in the import dialog or convert the file before importing.
Locale affects decimal separators, date order, and sometimes the interpretation of delimiters. A value such as 03/04/2026 can mean March 4 or April 3. Confirm the source system's convention before changing the spreadsheet locale.
Type conversion can also produce silent errors:
00127may become the number127.12-03may become a date.- Text beginning with
=may become a formula. - Long identifiers may be rounded if treated as numbers.
Import sensitive identifiers as text when the import dialog provides that option. If zeros have already disappeared, format a five-digit code with:
=TEXT(A2, "00000")Use a separate cleaned column until you have verified the result. Do not overwrite the raw import prematurely.
Test URL and Drive imports separately
IMPORTDATA requires a publicly reachable CSV or TSV URL. A URL that works in your browser may still require a login, redirect, or cookie, which prevents Sheets from fetching it. Test the URL in an incognito browser window and confirm that it returns the file itself, not an HTML page.
For a Drive import with Apps Script, check the file ID, Drive permissions, and the file's character encoding. Also confirm that the parsed rows have consistent widths before calling setValues. A range cannot receive rows with different numbers of columns.
Verify before trusting the result
After any successful import, compare:
- Expected and actual row counts.
- Expected and actual column counts.
- A few known identifiers and totals.
- Date ranges and decimal values.
- Blank values, duplicate rows, and unexpected formulas.
Use TRIM to remove unwanted spaces before lookups:
=ARRAYFORMULA(TRIM(A2:A))Then test a known lookup and inspect the first and last imported rows. A successful import is only the first step. Verification confirms that Sheets interpreted the file as intended.
Exercise
An imported CSV has correct columns, but ZIP code 00127 appears as 127. What should you check and how can you display the code correctly?
Show answer
Check whether the import converted the field to a number. Preserve it as text if possible, or use =TEXT(A2, "00000") in a cleaned column and verify other codes before applying the fix.