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.
| A | B | C | |
|---|---|---|---|
| 1 | Typed in | Cell shows | Excel keeps |
| 2 | 593774000123 | 5.93774E+11 | 593774000123 |
| 3 | 1234567890123456 | 1.23457E+15 | 1234567890123450 |
| 4 | '1234567890123456 | 1234567890123456 | 1234567890123456 |
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):
- Data > From Text/CSV (next to Get Data), and pick the file.
- In the preview, press Edit or Transform Data, whichever your version shows. The Power Query Editor opens.
- Click the header of the ID column, then Home > Transform > Data Type > Text.
- If Excel asks, pick Replace Current.
- 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.
- Inventory SpreadsheetStock tracker with a reorder list and a stock in and out log.
- Reseller Inventory and Profit TrackerInventory, profit and sales tax split by channel.
- Invoice Template and TrackerMake invoices and keep track of what is paid and what is still owed.
More how-tos
- Find a price by its code with XLOOKUPType a product code, get its price back from your price list. One formula, no helper columns.
- Total each category with SUMIFSAdd up all the Fuel, all the Office, all the Meals: one formula per category, and more rules when you need them.
- Check two conditions at once with IF and ANDFree shipping only when the order is 50 or more and ships in Canada: one IF, one AND, done.
- Add leading zeros to numbersType 00021 and Excel or Google Sheets shows 21, because to them it is just the number 21. Here is how to get the zeros back, and keep them.
- Fix #DIV/0! in an averageAn average of nothing is a division by zero, so AVERAGE shows #DIV/0! until the first number arrives. One IF fixes it.
- Count rows that meet two conditions with COUNTIFSHow many of Ana's deals were 500 or more? COUNTIFS answers it in one cell, and takes as many rules as you need.
- Calculate percentage changeSales went from 400 to 500. That is a 25% increase, and one short formula works it out for every row.
- Calculate years of service from a start dateAna started on 15 March 2019. How many full years has she worked? DATEDIF counts them, and the same formula works out an age from a date of birth.
- Combine first and last name into one cellFirst names in one column, last names in the next, and you need "Ana Lopez" in one cell. The & sign joins them.
- Find duplicates in a list with COUNTIFA mailing list where some people signed up twice. One formula shows how many times each email appears, so the repeats stand out.
- Split a full name into first and last nameYour list has "Ana Lopez" in one cell and you need Ana and Lopez in two. Two short formulas find the space and split there.
- Total amounts by month with SUMIFSA list of dated expenses and you want one total per month. SUMIFS adds every amount between the first and the last day of the month.
- Count working days between two datesAna is off from 1 Oct to 14 Oct. How many working days is that? NETWORKDAYS counts Monday to Friday and leaves out the weekends.
- Hide #N/A in VLOOKUP with IFERRORYour order list has a code that is not in the price list, and VLOOKUP shows #N/A. IFERROR puts your own words there instead.
- Count cells that contain textA stock list where some items have a note and most do not. One COUNTIF with an asterisk counts the notes and skips the empty cells.
- Make a running total (cumulative sum)Monthly sales in one column, the total so far in the next. One formula, filled down.
- Round to 2 decimal places, up or downA 15% discount turns 12.99 into 11.0415. ROUND makes it 11.04 and keeps your totals right to the cent. ROUNDUP and ROUNDDOWN handle the times when nearest is the wrong answer.
- How long to $1,000,000? FV and NPERPut $500 a month away at an example 7% a year. FV says what it grows to, NPER says when it passes $1,000,000. Two formulas, no calculator site.
- Why your formula gives the wrong number: the order of operationsA2 holds 10 and A3 holds 4. What does =A2-A3*2 give? It is 2, not 12. The same rule explains most formulas that look right and give the wrong number.
- Why your SUM says 0, and how to fix itThe amounts are right there in the column, and the total says 0. They look like numbers, but the sheet has them stored as text, and SUM skips text.
- Fill handle not working? Copy a formula down fastYou wrote one formula and need it in every row. Here are the quick ways to copy it down, and what to check when the fill handle will not show up or the copies come out wrong.
- Calculate hours worked from start and end timesA shift from 9:00 to 17:30 is 8.5 hours, but subtract the times and the cell shows 8:30. One small change turns it into a number you can add up and multiply by a pay rate.
- IF a cell is blank, or not blankYou want a formula to do one thing when a cell is empty and something else when it is filled. Two double quotes do the job, and they also catch the blanks ISBLANK misses.
- Formulas not updating? Recalculate and refreshYou change a number and the total does not move. It is nearly always one of a handful of things, and each one takes seconds to fix once you know which.
- Standard deviation in Excel and Google SheetsTwo shops both average 40 orders a day. One sells 38 to 42 every day; the other swings from 25 to 55. The average cannot tell them apart. The standard deviation can.
- Stack several columns into one column with TOCOLNames in three columns, one for each day, and you need them in one list. One formula does it, and the list keeps up when the columns change.
- Count how many times each value appears in a columnA staff list with a department on every row, and you need to know how many people are in each department. Two short formulas build the count table, and it keeps up when the list changes.
- Free pricing calculatorsPrice a job from your real costs and margin. No sign up.
- Free downloadsPractice sheets and printable pages, no email and no sign up.







