Instant digital downloadExcel and Google SheetsSecure card checkout

Excel how-to

Long numbers turn into E+ or end in 0 in Excel

You type a 12 digit order number and Excel shows 5.93774E+11. You type a 16 digit account number and the last digit turns into 0. The first one is only how the cell looks. The second is a real loss, and it has to be stopped before you type.

ABC
1Typed inCell showsExcel keeps
25937740001235.93774E+11593774000123
312345678901234561.23457E+151234567890123450
4'123456789012345612345678901234561234567890123456

Sample data typed into General cells. Row 2: 12 digits only look wrong. Row 3: 16 digits typed as a number, and the last one is now 0. Row 4: the same 16 digits after an apostrophe, kept as text with every digit.

Two different problems

They look alike, but only one of them loses anything.

  • E+ on 12 to 15 digits: only the look. Microsoft's number formats page says the General format "uses scientific (exponential) notation for large numbers (12 or more digits)". 5.93774E+11 means 5.93774 times 10 to the 11th. Click the cell and the formula bar still shows 593774000123.
  • 16 or more digits: a real loss. Microsoft's page on large numbers says "Excel has a maximum precision of 15 significant digits" and that digits past the 15th are rounded down to zero. 1234567890123456 goes in as 1234567890123450, and no format brings the 6 back.

Card numbers and some account and tracking numbers have 16 digits or more, so they are in the second group. Barcodes and most order numbers are shorter and only need the first fix.

Show every digit of a number up to 15 digits

Select the cells, press Ctrl+1, and on the Number tab pick Number with 0 decimal places (or pick Custom and type 0). 5.93774E+11 now shows as 593774000123. If the cell shows #### instead, widen the column.

That changes only the look, which is fine for a number you add up. For an ID you never add up, text is the safer home: a number drops any leading zero (see add leading zeros), and the next ID someone pastes may be 16 digits long.

Store 16 digit IDs as text, before you type

Select the column, press Ctrl+1, and on the Number tab select Text. Then type or paste the numbers. For one cell, start the entry with an apostrophe instead: Microsoft's large numbers page says "You can type an apostrophe (') in front of the number, and Excel will treat it as text". The apostrophe does not show in the cell, only in the formula bar.

Excel may put a small green triangle in the corner of these cells, its warning for a number stored as text. For an ID that is exactly what you want, so leave it. (When it is a price or a quantity, turn it back into a number.)

Already ends in 0? Enter it again

The order matters. About the Text format, Microsoft's page says: "This will not change numbers that have already been entered." A 16 digit number that already ends in 0 stays a number after you change the format, and the lost digit is gone for good. No formula can get it back.

So format the column as Text first, then type the numbers again, or paste them again from where they came from: the statement, the order system or the original file.

Turn off the 15 digit setting

Newer Excel has a switch for this. Go to File > Options > Data, find Automatic data conversion, and untick "Keep first 15 digits of long numbers and display in scientific notation". Microsoft's data options page says to disable it "to store numerical data with 16 or more digits as text and retain all digits". The same page lists it for Excel for Microsoft 365, Excel 2024 and Excel 2021.

The panel covers what you type, paste or load into Excel, and it has three more switches worth knowing:

  • Remove leading zeros and convert to a number: untick it and 00123 stays 00123.
  • Convert digits surrounding the letter "E" into a number in scientific notation: untick it and a code like 1E5 stays a code.
  • Convert continuous letters and numbers to a date: untick it and the page says "JAN1 remains as JAN1 in text and isn't converted to the date January 1".

Opening a CSV file

When you open a .csv file straight from a folder, Excel reads a long number in it the same way as one you type. To choose the column type yourself, import the file instead (the steps from Microsoft's large numbers page):

  1. Data > From Text/CSV (next to Get Data), and pick the file.
  2. In the preview, press Edit or Transform Data, whichever your version shows. The Power Query Editor opens.
  3. Click the header of the ID column, then Home > Transform > Data Type > Text.
  4. If Excel asks, pick Replace Current.
  5. Close & Load.

The column lands as text with every digit, and it stays that way each time you refresh it.

Check which cells are safe

Put this next to the first ID and fill it down:

=ISTEXT(A2)

TRUE means the ID is stored as text, so nothing was cut off on the way in. FALSE means it is a number. To mark the ones that already lost a digit:

=IF(AND(ISNUMBER(A2),A2>=10^15),"Re-enter","OK")

10^15 is the smallest 16 digit number, so Re-enter marks every number of 16 digits or more: its last digits are already zeros. The cut number still has 16 digits, so counting digits does not help; the type is what tells them apart. To count how many need typing again:

=COUNTIF(A2:A100,">=1E15")

COUNTIF skips the text IDs here, so it counts only the numbers that are too long.

Turn a number column into text IDs

Order numbers of 15 digits or fewer that are stored as numbers have lost nothing yet, and TEXT turns each one into text with every digit:

=TEXT(A2,"0")

593774000123 becomes the text 593774000123, all 12 characters, with no E+. Fill it down, then copy the column and use Paste Special > Values to keep the text and drop the formulas. On a 16 digit number TEXT only shows the 0 that is already there; it cannot bring the digit back.

Lookups between text IDs and numbers

XLOOKUP and VLOOKUP do not match a number to text, even when the digits are the same. If the payments list holds the order numbers as text in A2:A5 and the order you look up in D2 is a number, =XLOOKUP(D2,A2:A5,B2:B5,"Not found") says Not found. Turn the number into text inside the formula:

=XLOOKUP(TEXT(D2,"0"),A2:A5,B2:B5,"Not found")

That finds the order and returns what it paid. The other way round, a text ID looked up in a list of numbers, wrap the ID in VALUE instead of TEXT. Both work only up to 15 digits; past that, keep both lists as text.

Free practice sheet

Try it on three everyday jobs: which member account numbers kept all 16 digits and which must be typed again, 12 digit order numbers turned into text IDs, and a payments list in text matched to a shipped list in numbers. Each tab has yellow cells to fill in and a Check column that says Correct or Try again as you type, plus an Answers tab. Tabs 1 and 2 work in any Excel; tab 3 needs XLOOKUP (Excel for Microsoft 365, 2024 or 2021). Free, no sign up. Sample data.

Download the practice sheet (.xlsx)

Templates with the math already done

Rather skip the formulas? These templates come with every formula built and checked, plus a filled-in sample.

Get one tip like this a month

A free email from VARS Digital with one Excel or Google Sheets fix, tested in both apps. No spam, unsubscribe any time.

By signing up you agree that VARS Digital, 10151 240 Street, Maple Ridge, BC V2W 0G9, Canada (inquiries@varsdigital.app) may email you its newsletter: Excel and Google Sheets tips, updates and news about our templates and lessons. We send a confirmation email first, and nothing else goes out until you click it. Every email has an unsubscribe link, and you can leave any time. Details in our store policies.

More how-tos