New Tool Radar

AI for Data & Spreadsheets

How to Stop Excel Turning Long ID Numbers Into Scientific Notation on CSV Import

Stop Excel turning long ID numbers into scientific notation when importing a CSV.

Schematic with three steps: Check the ID length in a text; Import the ID column as Text; Check the imported IDs digit by digit.

A 16-digit card or account number imported into Excel becomes 1.23E+15, and worse, Excel keeps only 15 significant digits, so the last digit is lost for good. The number looks like a number and is no longer the number in the file. Import the column as Text before Excel can convert it, because the damage cannot be undone by formatting afterwards.

What you need

  • The CSV file with long ID numbers
  • Excel with a blank workbook
  • A note of which columns hold IDs rather than quantities

Step 1: Check the ID length in a text editor first

Open the CSV in a text editor and count the digits of one ID. Any number longer than 15 digits will lose precision in Excel if it is imported as a number, so those columns must be Text.

Step 2: Import the ID column as Text

Import through the Text Import Wizard and set the ID column format to Text in step 3. Leave genuine quantity columns as General so they still calculate.

Step 3: Check the imported IDs digit by digit

After loading, compare the first and last IDs with the file, digit by digit, including the last digit. The imported values must match exactly; a value shown in scientific notation has already lost precision.

Worked example: synthetic 16-digit ID list

The table below is a synthetic example. It shows the expected result of importing long IDs; no file was imported.

Check Value Result
IDs in the file 5 16 digits each
ID in the file 1234567890123456 Full 16 digits
ID after double-click open 1.23E+15 Shown in scientific notation
Stored value after open 1234567890123450 Last digit lost
ID after Text import 1234567890123456 All 16 digits kept

Expected result (UNTESTED). opening the file directly stores 1234567890123450, losing the final digit, while importing the column as Text keeps the full 1234567890123456. This check was not run live; the table shows the expected result for the synthetic example.

Limits

  • Excel keeps at most 15 significant digits for numbers; longer numbers always lose precision as numbers.
  • Formatting a scientific-notation cell back to Number shows the damaged value, not the original.
  • IDs are identifiers, not quantities, so Text is the right format even when they look like numbers.
  • A CSV that already holds the number in scientific notation is damaged before Excel opens it.

Sources

See all