Excel Keeps Changing Numbers to Dates? Fix It
In this article
Excel keeps turning dates out of your numbers because of two things working together: a cell format that is set to Date, and Excel's automatic conversion of anything that looks vaguely like a date when you type or paste it. To stop it, either set the column to Text before you enter data, or type an apostrophe before the entry so Excel treats it as text. If the conversion has already happened and the values are wrong, change the cell format back to General or Number and re-enter them. Below is the full fix, plus the paste and import situation, which is where most people get caught.
What You'll Need
- Excel on Windows or Mac, or Excel for the web. The menu names below are the desktop ones; on the web and Mac some labels sit under slightly different headings.
- A copy of your file if the data matters. Formatting and conversion fixes are hard to undo once you have saved.
- Knowing which entries are actually dates and which are codes, IDs, fractions or part numbers. This matters more than any setting.
Step-by-Step
- Work out whether the value changed or just the display. Click a problem cell and look at the formula bar at the top. If the formula bar still shows what you typed (for example 3-4) and only the cell shows a date, this is formatting. If the formula bar shows a date, Excel converted the value itself. The two need different fixes.
- For a cell that is only misformatted, change the number format. Select the cells, then use Home > Number Format and pick General or Number instead of Date. Or press Ctrl+1 (Command+1 on Mac) to open Format Cells and choose the format you want. This fixes the display without touching the underlying value.
- For values Excel genuinely converted, fix the format first, then re-enter. Changing the format to Text or Number after conversion does not restore the original text. Set the cells to Text, then retype or re-paste the original values. If the original was a real number, changing the format to Number and re-entering it is enough.
- Stop future conversion by setting the column to Text before typing. Select the whole column, open Format Cells with Ctrl+1, choose Text, and click OK. Everything you type or paste in afterwards is stored exactly as entered. This is the most reliable fix for part numbers, versions like 3-4, and codes such as 01/02.
- Use the apostrophe for one-off entries. Type an apostrophe before the value, for example '3-4 or '1/2. Excel treats it as text and hides the apostrophe in the cell. This is quick, but it is per entry, so it is not a good choice for a whole column of data.
- Fix pasted data with Paste Special. When you paste from another program, use Home > Paste > Paste Special (or right-click and choose Paste Special) and select Text, or use the Text Import Wizard when pasting plain text. Choosing Text during the paste stops Excel from reinterpreting the content.
- Fix imported files in the import step, not after. When you open a CSV with Data > From Text/CSV, use the wizard's column settings. Set the problem column's data type to Text rather than letting it be detected automatically. Doing it here is far cleaner than repairing the sheet afterwards, because the conversion never happens.
- Turn off automatic conversion of entries that look like dates. Open File > Options, go to the Advanced section, and look for the automatic data conversion options. Recent versions of Excel include settings to stop Excel from automatically converting text that looks like dates and from removing leading zeros. Clear the relevant checkboxes and click OK. The exact wording and placement vary by version, so look for the section on automatic data conversion rather than memorising a fixed label.
- Check for custom formats left behind by a template. If one workbook misbehaves and others do not, select the problem cells and open Format Cells. A custom format that includes date codes will keep showing dates even when the value is a number. Delete the custom format and set the cells to General.
- Save a working copy. Once the column behaves correctly, save the file, or save as .xlsx if you were editing a CSV. CSV files have no cell formatting, so a text column in a CSV will be reinterpreted the next time it is opened. Keeping the workbook as .xlsx preserves your Text formatting.
Common Mistakes
- Changing the format after the damage is done. Setting a column to Text afterwards does not bring back the original entries. Excel already stored a date serial number; only retyping restores the text.
- Opening a CSV by double-clicking. Double-clicking a CSV lets Excel guess each column's type, and guesses are where dates come from. Import it through Data > From Text/CSV so you choose the type yourself.
- Typing fractions and dates interchangeably. An entry like 3-4 turns into March 4, and 1/2 turns into January 2. If you meant a fraction, format the cells as Fraction, or enter 1/2 with a leading zero (0 1/2) or as a decimal.
- Trusting the display instead of the formula bar. A cell that looks like a date may be a number shown in date format. Always check the formula bar before deciding which fix applies.
- Setting only the cells you can see. If you format the visible rows as Text, new rows typed below can still convert. Format the entire column, not a range that stops halfway down.
Tips
- For long codes, use Text format plus a wide column so nothing is truncated or shown as #####.
- If you must show a date, enter it in a form Excel recognises clearly (like a full year such as 2024-03-04) and set the format deliberately, rather than letting Excel decide.
- When sharing a sheet with someone else, tell them which columns are Text. They can retype over a Text column and it will still convert if they retype after removing the formatting.
- Keep a spare copy of any raw import file. Repairing a sheet one cell at a time is slow; re-importing with the right column type takes a minute.
Troubleshooting
The apostrophe shows up in the cell. You probably typed the apostrophe into a cell that is already formatted as Text. In Text-formatted cells the apostrophe is not needed and may be visible. Clear it and just type the value.
A column still converts after you set it to Text. Check that you formatted the whole column, not just the current selection, and that the file was not saved as a CSV. Reopen the file and confirm the Text format is still there; if it is gone, the format was never stored.
Your original numbers are gone. If the workbook has not been saved since the conversion, press Ctrl+Z repeatedly to undo back past the paste or typing. Undo history is lost once the file is closed, so this only works within the session.
Only some cells misbehave. Formats are per cell, not per sheet. Select the odd cells, open Format Cells, set General and retype. A mixed column is usually the result of pasting data over formatted cells.
The whole sheet behaves strangely after a template was used. Select all with Ctrl+A, open Format Cells, set General, and re-enter any real dates you need. This resets inherited formatting but clears intentional formats too, so do it on a copy first.
Frequently Asked Questions
Why does Excel change 1-2 to a date?
Because the hyphen and slash are read as date separators. Excel interprets the number before as a month or day and the number after as the other. Formatting the cell as Text before entry, or typing an apostrophe first, prevents it.
Can I recover my original numbers after they became dates?
Not by changing the format. If you have not saved, undo. If you have saved, retype or re-import the original data. There is no reliable way to reconstruct text that was converted, because the stored value is now a date serial number, not your text.
Does setting a column to Text affect formulas?
Yes. A Text cell is not treated as a number, so SUM and similar functions ignore it, and calculations that expect dates will fail. Use Text only for columns that hold identifiers rather than values you need to calculate with.
Why does the date change again when I reopen the file?
The file is probably saved as CSV, which stores no cell formatting. Save it as .xlsx to keep the Text setting, or re-import the CSV each time with the column set to Text.
Does the same thing happen in Excel for the web and on Mac?
Yes, the conversion behaviour is the same. The menus differ: on Mac the options live under Excel > Preferences, and on the web the Format Cells dialog is reached from the Home tab. The wording of option labels can vary by version, device and region, so look for the nearest equivalent.