Sheet Clinic

Import a CSV without losing leading zeros, dates or long numbers

File > Import in Google Sheets turned ZIP 02134 into 2134 and code 3-14 into a date. Clear one box, then convert only the columns you need.

Sheet Clinic editorsPublished
D23/14/2026

Before imported with the box checked

ACDF
1Employee IDZIPDept codeBank account
241821343-14451237880092164
3422703010-273019264850217463
41107606144-18820193746
5935854012-730458812907765512
62016941102-2072215590

What changed

  1. Same CSV imported again
  2. Convert box cleared

After imported with the box cleared

ACDF
1Employee IDZIPDept codeBank account
200418021343-1400451237880092164
3004220703010-273019264850217463
401107606144-18820193746
5009350854012-730458812907765512
602016941102-200072215590
Figure 1. Four columns of one payroll CSV, imported twice into the same spreadsheet. The formula bar line is what D2 on the left really holds.

Emily Carter's ZIP code reads 02134, her employee ID 00418 and her department code 3-14 on the Fixed tab of the take-home copy, exactly as the payroll CSV wrote them. That tab came from File, then Import, with one box in the Import file dialog cleared: Convert text to numbers, dates, and formulas. Leave it checked and you get the Broken tab instead.

The file behind both tabs, payroll_export.csv, holds five employees written the way a payroll or bank export writes them. With the box checked, which is how the dialog opened, the ZIP became 2134 and the ID became 418. The department code still reads 3-14 in its cell, but select the cell and the formula bar says 3/14/2026. The IDs, ZIP codes, shorter account numbers, department codes, pay dates and net pay were stored as numbers or dates, and a stored number has no leading zeros to keep.

Import the file again with the convert box cleared

Undoing the damage cell by cell is the slow way, and for some columns it can't be done at all. The Fixed tab was made by importing the same file a second time, like this.

  1. File, then Import, then the Upload tab, and choose the CSV.
  2. Under Import location, pick Insert new sheets so the first attempt stays put for comparison.
  3. Clear the box Convert text to numbers, dates, and formulas.
  4. Click Import data, then rename the new tab. In the copy it's called Fixed.
Import file dialog for payroll_export.csv. Import location shows Create new spreadsheet, Separator type shows Detect automatically, and the box Convert text to numbers, dates, and formulas is checked.
Figure 2. The Import file dialog as it first opened, with the convert box already checked.

Google's Import data sets & spreadsheets page lists the other import locations, from replacing the whole spreadsheet to appending rows under the last row with data.

On the Fixed tab, every field arrived exactly as the file wrote it. A2 shows 00418 against the left edge of the cell, and its formula bar shows '00418. That leading apostrophe is how Sheets marks an entry as text. =LEN(C2) returned 5 there, against 4 on the Broken tab, and the department codes are plain text again.

Dept code 3-14 became a date, and two account numbers stayed text

Employee IDs and ZIP codes lost every leading zero: 00422 became 422, 07030 became 7030 and 08540 became 8540. Megan's 60614 and Olivia's 94110 had no zero to lose, so they look normal.

D2 displays 3-14, and the formula bar for D2 shows 3/14/2026. Each department code, 3-14, 10-2, 4-1, 12-7 and 2-20, can be read as a month and a day, so Sheets stored them as dates while the cells keep displaying the codes. In column M, =ISNUMBER(D2) returned TRUE, which is how a date answers that test.

Pay date went through the same conversion, and here it helped. 11/06/2026 became a real date, =ISNUMBER(E2) returned TRUE, and the cell still shows 11/06/2026. Net pay became numbers too. 1842.50 lost its trailing zero and shows 1842.5, but =SUM(G2:G6) returned 8650.5, the right total.

Bank account numbers came out mixed. 00451237880092164 lost two zeros and became 451237880092164. 0072215590 became 72215590. The two longest numbers, 73019264850217463 and 30458812907765512, were not converted at all: =COUNTA(F2:F6)-COUNT(F2:F6) returned 2, and =TEXT(F3,"0") gives back every digit of Jacob's account. So column F now holds numbers and text side by side.

Broken tab with D2 selected. The formula bar shows 3/14/2026 while D2 shows 3-14. Column A shows 418, 422, 1107, 935, 2016 and column C shows 2134, 7030, 60614, 8540, 94110. Column M shows 28, 8650.5, TRUE, TRUE, 4, 73019264850217463, 30458812907765512 and 2.
Figure 3. The Broken tab. D2 displays 3-14 but holds a date.

Net pay and Pay date need VALUE and DATEVALUE after an all-text import

Clearing the box keeps the zeros, and it also keeps the money as text. On the Fixed tab, =COUNT(A2:G6) returned 0 and =SUM(G2:G6) returned 0 as well. =ISNUMBER(E2) returned FALSE, so the pay dates are text too.

Two helper columns turn just those fields into numbers. H2 holds =ARRAYFORMULA(VALUE(G2:G6)), and VALUE fills the column with 1842.5, 1610, 2075.25, 1398.75 and 1724. =SUM(H2:H6) in M9 returned 8650.5, the same total the Broken tab had. I2 holds =ARRAYFORMULA(TO_DATE(DATEVALUE(E2:E6))). Each row shows 11/6/2026, and =ISNUMBER(I2) returned TRUE.

Fixed tab with A2 selected. The formula bar shows '00418. Columns A and C show 00418 and 02134 aligned left, column H shows 1842.5 to 1724 and column I shows 11/6/2026. Column M shows 0, 0, FALSE, FALSE, 5 and, lower down, 8650.5 and TRUE.
Figure 4. The Fixed tab. Columns A to G are text, and the numbers live in H and I.

TEXT with "00000" when the original file is gone

Sometimes the CSV is long deleted and all that's left is the converted tab. The Repair after import tab is a copy of the Broken tab with four formulas in H2 to K2:

  • =ARRAYFORMULA(TEXT(A2:A6,"00000")) returned 00418, 00422, 01107, 00935 and 02016.
  • =ARRAYFORMULA(TEXT(C2:C6,"00000")) returned 02134, 07030, 60614, 08540 and 94110.
  • =ARRAYFORMULA(TEXT(D2:D6,"m-d")) returned 3-14, 10-2, 4-1, 12-7 and 2-20.
  • =ARRAYFORMULA(TEXT(F2:F6,"0")) returned 451237880092164 for Emily and 72215590 for Olivia.

TEXT pads a number with zeros when the format has more zeros than the number has digits. That works for IDs and ZIP codes because every one of them is five characters long, so "00000" says exactly how many zeros to put back. The "m-d" format rebuilds the department codes from the dates, and all five came back as the file wrote them.

Account numbers differ in length, so no single format knows that Emily's account started with two zeros, and column K gives back the shortened 451237880092164. For that column, importing the original file again is the only route.

Repair after import tab with I2 selected. The formula bar shows =ARRAYFORMULA(TEXT(C2:C6,"00000")). Column H shows 00418 to 02016, column I shows 02134, 07030, 60614, 08540, 94110, column J shows 3-14 to 2-20 and column K shows 451237880092164 in row 2.
Figure 5. TEXT puts the zeros back in columns H and I. Column K cannot.

Use the Try it yourself tab for practice; it matches the Broken tab. Enter =ARRAYFORMULA(TEXT(A2:A6,"00000")) in H2, =ARRAYFORMULA(TEXT(C2:C6,"00000")) in I2 and =ARRAYFORMULA(TEXT(D2:D6,"m-d")) in J2, then compare H2:J6 with the same cells on Repair after import.

ZIP codes on the Fixed tab, read back on November 12

Inputpayroll_export.csv, five rows, File > Import with the convert box cleared
FormulaNone. Import data, Insert new sheets
Expected02134, 07030, 60614, 08540, 94110
Sheets returned02134, 07030, 60614, 08540, 94110 Matches expected
Checked2026-11-12, free personal account

The Import file dialog has one convert box for the whole file, with no setting per column. That is why the Fixed tab needs columns H and I for the two fields that should be numbers.

Take-home copy. Four tabs: Broken (as you see it), Fixed, Try it yourself, Repair after import. It opens as a copy in your own Drive.

Copy the sheet