Formatting Issues

How to Stop Excel from Converting Numbers and Codes to Dates

Amos GikundaAmos Gikunda Nov 10, 2026 870 views

Question details

User needs to prevent Excel from automatically interpreting and converting specific number formats or hyphenated codes into date values.

How to Stop Excel from Converting Numbers to Dates
Product
Excel
Device & OS
not provided
Scenario
Entering numerical codes, part numbers, or fractions that resemble dates into a spreadsheet.
Observed behavior
Excel automatically changes the entered code (such as 6-9240) into a date format, even if the cell is formatted as Number or General.
Before you start

Before re-entering your data, ensure you select the target cells and clear any existing date formatting to prevent the issue from reoccurring.

Solution 1Recommended

Format Cells as Text Before Entering Data

Applying the Text format to your cells beforehand tells Excel to treat any entered values exactly as typed, disabling automatic date conversion.

By default, Excel cells are formatted as 'General', which allows the software to guess the data type. Pre-formatting as Text forces Excel to read the input literally.

1
Select the target cells

Highlight the column, row, or specific range of cells where you plan to enter your codes or fractions.

2
Locate the Number format settings

Navigate to the 'Home' tab on the ribbon menu and locate the 'Number' group.

3
Apply the Text format

Click the format dropdown menu (which usually displays 'General' by default) and scroll to the bottom to select 'Text'.

4
Enter your data

Type your code (e.g., 6-9240) into the newly formatted cell. Excel will now keep the exact characters without converting them to a date.

Format Cells as Text Before Entering Data
Important Timing: You must apply the Text format before typing the data. If Excel has already converted the value to a date, formatting it as Text afterward will just display a 5-digit date serial number.
WPS Spreadsheet Solution

Use WPS Spreadsheet to Manage Data Without Formatting Errors

WPS Office offers a powerful spreadsheet tool that provides precise control over cell formatting. You can easily stop automatic date conversions and handle large datasets effectively while maintaining exactly what you type.

  1. 1. Open WPS Spreadsheet: Launch WPS Office and open your workbook in the Spreadsheet module.
  2. 2. Select your data range: Highlight the cells, rows, or columns where you will enter the hyphenated codes.
  3. 3. Open Format Cells dialog: Right-click the selected area and choose 'Format Cells', or use the keyboard shortcut Ctrl+1.
  4. 4. Apply Text formatting: Under the 'Number' tab, click on 'Text' in the category list and click 'OK'.
  5. 5. Input data securely: Enter your codes safely knowing WPS Spreadsheet will preserve your exact input without auto-formatting to dates.
Easily pre-format cells as Text to prevent unwanted date conversions.Fully compatible with Microsoft Excel (.xlsx, .xls, and .csv) file formats.Free, lightweight, and features an intuitive, familiar user interface.Includes robust batch data validation and text-to-columns tools.
microsoft office alternative - wps office

Frequently Asked Questions

Why does Excel convert my numbers to dates automatically?

Excel is programmed to recognize common date patterns (like fractions, month-year combinations, or hyphenated numbers) to make data entry faster for users who are actually entering dates. This aggressive auto-formatting can inadvertently convert non-date items like part numbers or codes.

Can I turn off auto-date conversion globally in Excel settings?

In newer versions of Excel, you can disable some automatic data conversions. Go to File > Options > Data, and look for 'Automatic Data Conversion' settings to uncheck converting numbers to dates. In older versions, this global setting is not available, and you must use the Text format or apostrophe method.

How do I fix a code that has already been converted to a date?

Once Excel converts a code to a date, the original text data is lost in the background. Changing the cell format back to Text will only show a 5-digit date serial number (e.g., 43831). You must delete the incorrect date, format the cell as Text, and retype the original code.