Smart Systems for Home

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

Excel Keeps Changing Number to Date: How to Fix It

· 6 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 changing numbers to dates, you must change the cell format to Number, General, or Text before or after entering the data. This happens because Excel uses a date system where the number 1 represents January 1, 1900; therefore, any number entered into a cell previously formatted as a date—or any entry that looks like a date (e.g., 1/2)—is automatically converted. Depending on your version of Excel, menu labels may differ slightly, but the core formatting logic remains the same across Windows and macOS.

What You'll Need

  • A computer with Microsoft Excel installed (Desktop version) or access to Excel for the Web.
  • The specific dataset or spreadsheet where the conversion is occurring.
  • Administrative access to the workbook (the sheet must not be protected or read-only).

Step-by-Step

  1. Identify the Affected Cells: Click on the cell or highlight the range of cells that are displaying dates instead of numbers. If the entire column is affected, click the letter at the top of the column to select every cell in that vertical line.
  2. Open the Home Tab: Navigate to the top ribbon of the Excel interface and ensure you are on the Home tab.
  3. Locate the Number Format Dropdown: In the middle of the Home ribbon, you will see a group labeled Number. There is a dropdown menu that likely currently says "Date" or "Custom."
  4. Change the Format: Click the dropdown arrow and select General or Number from the list.
    • General: This is the default. It allows Excel to decide the best format based on what you type.
    • Number: This forces the cell to display as a numeric value. You can further adjust decimal places using the "Increase Decimal" or "Decrease Decimal" buttons located immediately below the dropdown.
  5. Re-enter the Data: In some cases, simply changing the format will turn the date back into a number (e.g., "Jan-01-1900" becomes "1"). However, if Excel has already "hard-coded" the entry as a date, you may need to double-click the cell and press Enter, or re-type the number entirely to trigger the new formatting rule.
  6. Prevent Future Conversions (Pre-Formatting): If you know you are about to enter numbers that look like dates (such as 1-5 or 10/12), select the empty cells first. Go to the Number Format dropdown and select Text. When a cell is formatted as Text, Excel treats every entry as a literal string of characters and will not attempt to guess if it is a date, time, or currency.

Common Mistakes

One of the most frequent errors is attempting to fix the issue by typing an apostrophe (') before the number. While this works to force the cell into Text format, it creates a "green triangle" warning in the corner of the cell, indicating that a number is stored as text. This can cause problems later if you intend to use those numbers in formulas (like SUM or AVERAGE), as Excel may ignore text-formatted numbers in certain calculations.

Another common mistake is applying the format after the data has been corrupted in a way that cannot be reversed. If you import a CSV file and Excel automatically converts your product IDs (like 1-123) into dates (January 123rd), simply changing the format back to "General" will not restore the original ID. Instead, it will turn the date into the serial number Excel uses internally (e.g., 45231). In these cases, the data is lost during the import process, and you must re-import the data using the "Get Data" or "Text to Columns" wizard to specify the column format as Text before the data hits the sheet.

Users also often forget that formatting is cell-specific. Applying a fix to one cell does not fix the rest of the column. Always select the entire range or the whole column before applying the Number or Text format to ensure consistency across the dataset.

Tips

To speed up the formatting process, you can use keyboard shortcuts. On Windows, pressing Ctrl + Shift + ~ (the tilde key) quickly resets the selected cells to the General format. Pressing Ctrl + Shift + ! applies the Number format with two decimal places and a thousands separator.

If you are dealing with a massive amount of data, use the Format Painter. Once you have one cell formatted correctly as a Number or Text, click that cell, click the Format Painter icon (the paintbrush) on the Home tab, and then click and drag over all other cells that need the same fix. This is often faster than using the dropdown menu for multiple non-contiguous ranges.

When working with IDs, SKU numbers, or account numbers that start with zeros (e.g., 00123), always use the Text format. If you use the Number format, Excel will automatically remove the leading zeros because they have no mathematical value, changing "00123" to "123".

Troubleshooting

If the number still looks like a date after changing the format: Double-check that you haven't applied a "Custom" format that overrides the General setting. Right-click the cell, select Format Cells, go to the Number tab, and ensure that "General" is selected and that no specific custom code (like dd-mm-yyyy) is written in the Type box.

If the cell shows "#######": This does not mean the date conversion failed; it means the column is too narrow to display the resulting number. Hover your mouse over the boundary between the column letters at the top and double-click to auto-fit the column width.

If you imported a CSV and the numbers are already dates: Do not try to format them back. Instead, go to the Data tab, select From Text/CSV, and when the preview window appears, click Transform Data. In the Power Query editor, find the column in question, click the data type icon (usually a small calendar or number icon in the header), and change it to Text. Then click Close & Load. This prevents Excel from ever interpreting the numbers as dates during the import.

If formulas are not working after changing to Text: Remember that the Text format is a "dead end" for math. If you need to perform calculations on these numbers, you must change the format back to Number. If the numbers are stored as text, you can use the =VALUE() function in a neighboring cell to convert the text string back into a usable number.

Frequently Asked Questions

Why does Excel think 1-2 is a date?

Excel is designed to be helpful by guessing the data type. Because "1-2" matches the common pattern for month and day, Excel automatically converts it to the first of February of the current year. To prevent this, format the cell as Text before typing.

Can I stop Excel from doing this globally for all workbooks?

No, there is no global setting to disable automatic date conversion across all of Excel. This is a core behavior of the software. You must manage formatting on a per-workbook or per-column basis.

What is a date serial number?

Excel stores dates as sequential serial numbers so they can be used in calculations. For example, January 1, 1900, is serial number 1. If you see a number like 45231 when you expected a date, it is simply the raw number behind the date formatting.

Does this happen in Google Sheets too?

Yes, Google Sheets uses a very similar logic to Excel. You can fix it using the Format > Number menu to select Plain Text or Number.

Will changing the format delete my data?

Changing the format from Date to Number will not delete your data, but it will change how it is displayed. However, if the data was converted to a date during a CSV import, the original precision of the number may have been lost, and changing the format won't bring back the original digits.