Why Excel Changes IDs, Dates & Long Numbers & How to Stop It
- Average speed
- km/h
- Result
- Finish time
- 50 min
- You entered
- Distance
- 10 km
- You entered
Excel automatically converts long numbers (like credit card IDs or serial numbers) to scientific notation and turns text that looks like a date (e.g., “1-2”) into an actual date, which corrupts your data. You can prevent this by pre-formatting cells as Text, using the Import Wizard, or typing an apostrophe before the entry. This article explains exactly why Excel does this and gives you step-by-step fixes that work in Excel 2010 through Microsoft 365.
Why Excel Changes Your Data
Excel has a 15-digit precision limit for numbers. Any number longer than 15 digits gets the digits after the 15th replaced with zeros, and if it’s very large or very small, Excel displays it in scientific notation (e.g., 1.23E+15). This is not a display glitch – the underlying value is permanently altered.
For dates, Excel stores every date as a serial number (1 = January 1, 1900). When you type something that looks like a date, like “3-4” or “12/5”, Excel interprets it as a date and reformats the cell accordingly. This is a feature for date entry, but a disaster when you meant to type an ID like “3-4” or a part number like “12/5”.
The problem is worst when you paste data from another program or import a CSV file. Excel’s automatic type detection kicks in before you have a chance to stop it.
How Excel’s Type Detection Works
When you type or paste a value, Excel looks at the characters and decides what data type it should be. The rules are simple:
- If it’s all digits and longer than 15 characters, it becomes scientific notation.
- If it matches a date pattern (like 1-2, 1/2, 1.2, or 1:2), it becomes a date.
- If it has leading zeros (like 00123), the zeros are dropped.
This happens at the moment of entry, before any cell formatting can help. That’s why changing the format after you’ve already typed the value doesn’t restore the original – the damage is already done.
Preventing Changes When Typing Manually
If you’re entering data by hand, you have three reliable options:
- Format as Text first: Select the column, go to Home → Number → Text, then type. Excel will treat everything as text and won’t convert.
- Type an apostrophe: For a single entry, type an apostrophe before the value (e.g., ‘00123). The apostrophe tells Excel to treat it as text and is not displayed.
- Use the Text Import Wizard: When importing a CSV or text file, choose “Text” for the columns that contain IDs or long numbers.
These methods work in every version of Excel. The apostrophe trick is the fastest for one-off entries.
Preventing Changes When Pasting or Importing
Pasting is where most data gets corrupted. To paste safely:
- Copy your data from the source.
- In Excel, select the destination cell.
- Right-click → Paste Special → Values (or Text). This bypasses the type detection.
- If you’re pasting from a web page or another program, use the “Match Destination Formatting” option if available.
For CSV imports, don’t double-click the file – that opens it directly and applies default conversions. Instead, open Excel, go to Data → From Text/CSV, and in the import wizard set each column’s data type to “Text” before loading.
What to Do If Your Data Is Already Corrupted
If you’ve already lost the data, you can’t recover the original digits from Excel alone – the value is gone. However, you can prevent it from happening again by using the methods above. If you have the original file (like a CSV), re-import it using the Text Import Wizard and set the correct column types.
For dates that have been converted, you can sometimes reverse them by changing the cell format to Text, but the underlying serial number remains. For example, if you typed “1-2” and Excel turned it into January 2, 2024, the cell contains the serial number 45293, not the text “1-2”. You’d need to re-enter the data.
Common Mistakes and Misconceptions
One common mistake is thinking that changing the cell format to “Number” with more decimal places will restore the digits. It won’t – the precision is already lost. Another is using the “General” format for columns that contain IDs; you must explicitly set them to Text.
Some users try to use a custom number format like “0” to display the full number, but this only works if the number is 15 digits or less. For longer numbers, the only solution is to store the value as text from the start.
Another misconception is that Excel’s “Convert to Number” warning (the green triangle) is the problem. That warning appears when you have text that looks like a number – it’s actually a sign that Excel is NOT converting it, which is what you want for IDs.
Alternatives for Handling Long Numbers
If you frequently work with long IDs (like credit card numbers, ISBNs, or tracking numbers), consider these alternatives:
- Use a dedicated database (like Access or SQLite) where you can define fields as text.
- Use Excel’s Power Query (Get & Transform) to import data – it gives you more control over column types.
- Store the data in a text file and use Excel only for analysis, not as the primary storage.
For dates, if you need to keep the original text format, you can use a leading apostrophe or format the column as Text before entering. If you’re importing a CSV with date-like IDs, always use the import wizard.
Frequently Asked Questions
Why does Excel show 1.23E+15 for my long number?
Excel uses scientific notation for numbers with more than 15 digits because it only stores 15 significant digits. The “E+15” means the number is multiplied by 10 to the 15th power. To prevent this, store the number as text.
Can I recover the original digits after Excel changes them?
No, not from Excel alone. Once Excel converts a long number to scientific notation, the original digits beyond the 15th are permanently lost. You must re-enter or re-import the data with the correct text formatting.
Does the apostrophe trick work in all versions of Excel?
Yes. Typing an apostrophe before any value forces Excel to treat it as text, and the apostrophe is not displayed. This has been a feature since early Excel versions and still works in Microsoft 365.
Why does Excel change “1-2” to a date?
Excel interprets “1-2” as a date (January 2) because it matches a common date format. To prevent this, format the cell as Text before typing, or type an apostrophe first.
What is the best way to import a CSV with long IDs?
Use Excel’s Data → From Text/CSV feature. In the import wizard, select each column and set its data type to “Text” before loading. Do not double-click the CSV file, as that opens it with automatic conversions.
Related
Formula used
in t | Finish time | min | 50 | 0 in d | Distance | km | 10 | 0 out pace | Average pace | min/km | t / d | 2 out speed | Average speed | km/h | d / (t / 60) | 2
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.