Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Excel Keeps Turning Numbers into Dates: How to Fix It

· 7 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To stop Excel from turning numbers into dates, change the cell format to "Text" or "Number" before typing, or add a single apostrophe (') before the entry. This happens because Excel uses an automatic data detection system that interprets certain number patterns—specifically those with slashes, dashes, or periods—as calendar dates to be helpful, though it often results in data corruption for part numbers, IDs, or codes.

What You'll Need

  • A computer with Microsoft Excel installed (Windows or macOS).
  • The dataset or specific cells that are currently exhibiting the date-conversion behavior.
  • Administrative access to the spreadsheet to change formatting settings.

Step-by-Step

Depending on whether you have already entered the data or are preparing to enter it, use one of the following methods. Note that menu labels may differ slightly depending on your version of Excel, your operating system, or your regional language settings.

Method 1: Pre-Formatting Cells as Text (Best for New Data)

  1. Open your Excel workbook and navigate to the worksheet containing the target cells.
  2. Click and drag your mouse to highlight the range of cells, columns, or rows where you intend to enter your numbers.
  3. Go to the Home tab on the top ribbon.
  4. Locate the Number group. You will see a dropdown menu that usually says "General" by default.
  5. Click the dropdown arrow and scroll down to the bottom of the list to select Text.
  6. Now, type your numbers into these cells. Excel will treat every character exactly as entered and will not attempt to convert patterns into dates.

Method 2: Using the Apostrophe Shortcut (Best for Quick Entries)

  1. Select the cell where you want to enter the number.
  2. Type a single quotation mark or apostrophe (') as the very first character.
  3. Immediately follow the apostrophe with your number (e.g., '12-05).
  4. Press Enter.
  5. The apostrophe will be visible in the formula bar but will remain invisible in the cell itself. This tells Excel to ignore all automatic formatting and treat the cell contents as a literal string of text.

Method 3: Fixing Existing Date-Converted Numbers

If Excel has already converted your numbers into dates, simply changing the format back to "Number" often results in a five-digit integer (the serial number Excel uses to track dates). To fix this, you must clear the data and the format simultaneously.

  1. Select the cells that have been incorrectly converted to dates.
  2. Go to the Home tab, click the Number dropdown, and select Text.
  3. Because Excel does not retroactively change the value of the cell, you must now re-enter the data.
  4. Double-click the cell or press F2 to enter edit mode, then press Enter. The value will now remain as text.

Method 4: Using the Text Import Wizard (Best for CSV Files)

  1. Instead of double-clicking a CSV file to open it, open a blank Excel workbook first.
  2. Go to the Data tab on the ribbon.
  3. Select Get Data > From File > From Text/CSV.
  4. Select your file and click Import.
  5. In the preview window that appears, do not click "Load". Instead, click Transform Data to open the Power Query Editor.
  6. Locate the column that is being converted to dates. Right-click the column header.
  7. Select Change Type and choose Text.
  8. When prompted to replace current conversion, select Replace current.
  9. Click Close & Load in the top left corner to bring the correctly formatted data into your sheet.

Common Mistakes

  • Changing Format After Entry: The most common error is typing a number (like 1-2), letting Excel turn it into "1-Jan", and then changing the cell format to "Number". This results in a number like 45292, which is the internal date code. Once the conversion happens, the original input is lost unless you undo the action immediately.
  • Applying Formatting to Only One Cell: Users often format one cell as text, then drag the fill handle down. Depending on the version, this can sometimes reset the formatting of the destination cells. It is always safer to highlight the entire column first.
  • Confusing "Text" with "General": The "General" format is the default, but it is exactly what causes the problem. "General" allows Excel to guess the data type. You must explicitly choose "Text" to disable this guessing mechanism.
  • Using Slashes in Numbers: Typing "10/12" is a primary trigger for date conversion. If these are meant to be fractions or part numbers, the "Text" format is mandatory.

Tips

  • Use Table Formatting: If you convert your range into an official Excel Table (Ctrl+T), formatting applied to a column is more likely to be maintained consistently as you add new rows to the bottom of the list.
  • Check the Formula Bar: If you aren't sure if a cell is a date or text, look at the Formula Bar. If the cell shows "Jan-12" but the formula bar shows "1/12/2024", Excel has converted it to a date. If the formula bar shows "1/12", it is likely still text.
  • Batch Conversion: If you have a massive amount of data that was converted to dates, you can sometimes use the Text to Columns feature on the Data tab. Select the column, go to Text to Columns, click Next twice to get to Step 3, select "Text" as the column data format, and click Finish.
  • Consistency in Data Entry: Establish a rule for your team to use the apostrophe method for one-off entries to prevent the spreadsheet from becoming a mix of date and text formats, which can break sorting and filtering.

Troubleshooting

If you have followed the steps above and Excel is still behaving unexpectedly, try these solutions in order of complexity:

  1. Clear All Formats: Sometimes hidden formatting persists. Select the problematic cells, go to the Home tab, look for the Editing group, click Clear, and select Clear Formats. Then, re-apply the "Text" format and re-enter your data.
  2. Check for AutoCorrect Rules: In rare cases, a custom AutoCorrect entry might be changing your input. Go to File > Options > Proofing > AutoCorrect Options and ensure there are no rules that replace your specific number patterns with date-like strings.
  3. Verify Regional Settings: Excel relies on your computer's system clock and regional settings (Control Panel > Region in Windows). If your system is set to a region that uses a different date separator (e.g., dots instead of slashes), Excel may trigger date conversion on patterns you wouldn't expect.
  4. Disable Automatic Data Conversion (Newer Versions): In the most recent versions of Microsoft 365, Microsoft has introduced a setting to disable some automatic conversions. Go to File > Options > Data. Under the "Automatic Data Conversion" section, look for the option that says "Remove leading zeros and convert to a number" or similar date-conversion toggles and uncheck them.

Frequently Asked Questions

Why does Excel do this in the first place?

Excel is designed to minimize manual data entry. Since many users enter dates using shorthand (like 1/5 for January 5th), Excel automatically converts these patterns into date objects so that you can perform date-based calculations, such as adding days or sorting chronologically.

Can I stop this from happening globally for all workbooks?

For older versions of Excel, there is no global "off" switch for date detection; it must be handled on a per-cell or per-column basis. However, newer Microsoft 365 updates are adding more granular controls in the Data Options menu to reduce these automatic conversions.

Will formatting a cell as text affect my ability to do math?

Yes. Once a cell is formatted as "Text", Excel treats the number as a string of characters. If you try to use a SUM formula on text-formatted numbers, they may be ignored. To perform calculations, you would need to convert them back to "Number" or use a function like VALUE().

What happens if I import a CSV and the dates are already ruined?

If you open a CSV by double-clicking it, Excel applies its default logic and converts the data instantly. Once the file is saved in this state, the original data is often lost. To prevent this, always use the Data > Get Data method to explicitly define the column as "Text" during the import process.

Does the apostrophe method work in Google Sheets too?

Yes, the single apostrophe (') prefix is a universal spreadsheet convention used by both Microsoft Excel and Google Sheets to force a cell to be treated as plain text.