Table of Contents
To stop Excel interpreting a code such as 1-2 or 1/2 as a date, format the destination cells as Text before entering the data. For a fraction you want to calculate with, use Fraction formatting or enter a zero and a space, such as 0 1/2.
The right method depends on what the value means. A product code should remain text; a fraction used in arithmetic should remain a number. Date conversion is not necessarily caused by a Custom format or an AutoCorrect rule.
Format codes and labels as Text first
- Select the empty cells or column where you will enter the values.
- On Home, open the number-format list and choose Text. In desktop Excel for Windows, you can also press Ctrl + 1, select Text, and click OK.
- Enter your data and check that values containing slashes, hyphens, or leading zeros remain as intended.

This is useful for identifiers, reference numbers, and labels that resemble dates. Text values are not ordinary numeric values for calculations, so do not apply this format indiscriminately to a column of measurements.
For pasted data, check a small sample first. Pasting from another workbook can carry source formatting; a values-only paste into a prepared range avoids importing that formatting. CSV files need a separate import check, described below.
Use an apostrophe for individual text entries
For a few cells, type a straight apostrophe before the value: for example, '1/2 or '11-53. Excel treats the entry as text and hides the prefix in the worksheet cell.

The prefix can be visible when inspecting or editing the entry in the formula bar. A “number stored as text” indicator may appear; if the entry is intentionally an identifier, do not convert it back to a number merely to remove the indicator.
Use the same approach when leading zeros are part of the code. TipsMake's guide to keeping leading zeros in Excel explains the difference between preserving a text value and adding zeros only for display.
Enter fractions as numbers
If you need to add, average, or multiply a fraction, avoid the apostrophe method. Choose one of these options:
- Preformat as Fraction: select the cells, open Format Cells, choose Fraction, select a suitable fraction type, and then enter the values.
- Prefix with zero and a space: in an unformatted cell, enter
0 1/2. Excel stores the numeric value and displays it as a fraction.

The chosen fraction format controls the displayed denominator and rounding. It does not change the underlying numeric value. For example, a decimal value can display as a fraction without becoming text. See fraction formatting in Excel for the available display choices.
What if Excel has already converted the entry?
Changing a date-formatted cell to Text or General does not reconstruct the original characters. Excel stores dates as numeric serial values, so changing the display may reveal a number rather than the original code or fraction.
If the conversion just happened, undo it, apply the correct format, and re-enter the original value. For an existing dataset, return to the source and re-import or re-enter the affected values. Do not guess from the displayed date when the original sequence matters.
Check automatic conversion and CSV imports
Recent supported desktop editions, including Excel for Microsoft 365 and Excel 2024, provide Automatic Data Conversion options. The date-related option covers continuous letters and numbers such as JAN1; it is not a blanket switch that prevents every slash or hyphen expression from being recognized as a date.
For imported files, use Data > From Text/CSV where available, inspect the preview, and explicitly set code columns to Text before loading. In Power Query, review automatic type-change steps so conversion has not already occurred before the Text step. Re-import from the original file if needed.
Keep a copy of the source file and verify representative codes, fractions, and dates after loading. Consistent column types make later formulas more reliable; TipsMake's guide to clean tables and data types covers that distinction.
Reader Comments 0
Sign in with email or Google to join the discussion.