How to Stop Microsoft Excel from Automatically Reformatting Numbers as Dates

The Infamous Date Formatting Bug

One of the most notorious and universally despised features in Microsoft Excel is its aggressive automatic date formatting. Because Excel tries to be helpful, if you type any string of numbers separated by a hyphen or a slash (such as “3-4” or “1/2”), Excel instantly assumes you are typing a date. It will immediately reformat your entry to “04-Mar” or “02-Jan”. This is catastrophic for scientists entering gene names (like “MARCH1”), inventory managers entering part numbers, or accountants entering fractions. What makes it worse is that once Excel converts the data into a date serial number, simply changing the cell format back to “Text” will not restore your original entry; it will just show the raw date serial integer.

How to Prevent Automatic Date Formatting

The only foolproof way to stop Excel from converting your numbers into dates is to tell the program that the cell is strictly text before you type the data, or to use a specific syntax trick while typing.

Method 1: Pre-format the Cells to Text

If you know you are about to paste or type a large column of fractions or hyphenated part numbers, format the column first.

1. Highlight the entire column (or the specific block of empty cells) where you plan to enter the data.

2. In the Home tab on the main ribbon, look for the Number group in the center.

3. Click the drop-down menu that currently says “General”.

4. Scroll all the way to the bottom of the list and select Text.

Now, when you type “3-4” into those cells, Excel will treat it exactly as a string of text characters and will not attempt to calculate a date.

Method 2: Use the Apostrophe Trick

If you are just entering data on the fly and don’t want to format entire columns, you can force Excel to interpret a single entry as text by using a prefix.

Before you type your number, type a single apostrophe (). For example, type '3-4 and hit Enter.

The apostrophe acts as a hidden command character. It tells Excel, “Treat everything after this symbol as plain text.” The apostrophe will remain hidden in the cell view (it only shows in the formula bar), but your “3-4” entry will remain perfectly intact without turning into a date.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.