How to Stop Excel from Converting 4-2 into a Date
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.

- 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 type the value, select the cells that will receive 4-2 and check whether they use the General or Date format.
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.
Open your workbook in WPS Office or Excel and select the cell or range where you want to enter 4-2.
Right-click the selection and choose Format Cells, or press Ctrl+1 to open the dialog.
On the Number tab, select Text, then click OK to confirm.
Enter 4-2 in the formatted cell and press Enter. The value remains exactly as typed.

Prefix the Entry with an Apostrophe to Keep 4-2 as Text
Use this quick method for occasional entries when you do not want to change the cell format first.
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. Open WPS Office Spreadsheets: Launch WPS Office and open the workbook where you need to enter 4-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. Enter the value: Type 4-2 and press Enter. WPS keeps the entry as text instead of converting it to a date.
- 4. Use the apostrophe shortcut as needed: For a single entry, type '4-2; the apostrophe is hidden and prevents date conversion.

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.




