Formatting Issues

How to Stop Excel from Converting 4-2 into a Date

Khadija KhanKhadija Khan Nov 13, 2026 869 views

Question details

The user needs to enter the value 4-2 in a worksheet without Excel or WPS Office Spreadsheets automatically changing it into a date.

How to Stop Excel from Converting 4-2 into a Date
Product
WPS Office Spreadsheets / Microsoft Excel
Device & OS
not provided
Scenario
The user is entering a hyphenated numeric value such as 4-2 into a worksheet and wants it to remain exactly as typed.
Observed behavior
Excel or WPS Office Spreadsheets interprets 4-2 as a date and changes the cell value instead of keeping the original text.
Before you start

Before you type the value, select the cells that will receive 4-2 and check whether they use the General or Date format.

Solution 1Recommended

Set the Cell Number Format to Text Before Entering 4-2

Use this method when you are entering multiple hyphenated codes or values that must stay exactly as typed.

Applying the Text number format tells the spreadsheet application to treat the entry as literal characters instead of recognizing it as a date pattern.

1
Select the target cells

Open your workbook in WPS Office or Excel and select the cell or range where you want to enter 4-2.

2
Open Format Cells

Right-click the selection and choose Format Cells, or press Ctrl+1 to open the dialog.

3
Apply Text format

On the Number tab, select Text, then click OK to confirm.

4
Type the value

Enter 4-2 in the formatted cell and press Enter. The value remains exactly as typed.

Set the Cell Number Format to Text Before Entering 4-2
Date conversion prevented: The cell keeps 4-2 as text instead of changing it to a date. This works in WPS Office Spreadsheets and Microsoft Excel.

Prevent Date Conversion in WPS Office Spreadsheets

WPS Office Spreadsheets lets you stop Excel-style date conversion by applying Text formatting or using an apostrophe before entering 4-2, so your data stays exactly as typed.

  1. 1. Open WPS Office Spreadsheets: Launch WPS Office and open the workbook where you need to enter 4-2.
  2. 2. Select and format the target cells: Select the cell or range, right-click, choose Format Cells, and set the Number tab to Text.
  3. 3. Enter the value: Type 4-2 and press Enter. WPS keeps the entry as text instead of converting it to a date.
  4. 4. Use the apostrophe shortcut as needed: For a single entry, type '4-2; the apostrophe is hidden and prevents date conversion.
Preserve entries like 4-2 as literal text without unexpected date changesFull compatibility with Microsoft Excel XLSX filesFree to download and use with a familiar Office-style interfaceLightweight and fast for everyday spreadsheet tasks
QA img-9

Frequently Asked Questions

Why does Excel change 4-2 into a date?

Excel and WPS Office Spreadsheets recognize the number-hyphen-number pattern as a possible date and apply a date format automatically. To prevent this, format the cell as Text or type an apostrophe before 4-2.

How do I stop WPS Spreadsheets from converting hyphenated numbers into dates?

Select the target cells, press Ctrl+1, choose Text on the Number tab, and click OK. Then enter the hyphenated value normally.

Can I type 4-2 without changing the cell format?

Yes. Type an apostrophe before the value, such as '4-2, and press Enter. The apostrophe is hidden and the cell displays 4-2 as text.

What if 4-2 already turned into a date?

Change the cell format to Text and re-enter the value. You can also use the Text to Columns feature to convert existing date entries back to text.

Does Text formatting affect calculations?

Yes. Values stored as text are not calculated as numbers. Use Text formatting for codes or identifiers that should remain unchanged.