Prevent Excel from Treating Hyphen-Prefixed Text as a Formula in WPS Office
Question details
User needs to enter or paste text that begins with a hyphen into a spreadsheet without it being converted to a formula that returns #NAME?.

- Product
- WPS Office Spreadsheets
- Device & OS
- not provided
- Scenario
- The user is pasting or typing hyphen-prefixed text into spreadsheet cells and wants it to remain literal text.
- Observed behavior
- The spreadsheet treats the leading hyphen as a formula trigger, adds an equals sign, and returns a #NAME? error.
Before pasting, decide whether the hyphen-prefixed entries are one-off manual inputs or a large pasted range. For pasted ranges, set the destination cells to Text format first; for single entries, you can type an apostrophe before the text.
Pre-format destination cells as Text before pasting
Use this when pasting multiple hyphen-prefixed values; it keeps all pasted content as literal text.
When a cell is formatted as Text before data entry or pasting, WPS Office Spreadsheets does not interpret a leading hyphen or minus sign as the start of a formula.
Open your WPS Office spreadsheet and select the cells or range where the hyphen-prefixed text will be pasted.
Right-click the selected range and choose Format Cells, or press Ctrl+1.
In the Number tab, select Text and click OK.
Paste the copied text. Use Paste Special > Text or press Ctrl+Shift+V to paste values without source formatting.

Type an apostrophe before a single hyphen-prefixed entry
Use this for manual single-cell entry when you do not want to change the cell format.
Remove existing hyphens with SUBSTITUTE or Text to Columns
Use this after text has already been imported and you need to clean hyphen characters from cell values.
Set Text Format in WPS Office Spreadsheets to Keep Hyphen-Prefixed Text Safe
WPS Office Spreadsheets gives you the same Text-format and apostrophe controls as Excel, so you can paste or type leading-hyphen text without #NAME? errors and keep full XLSX compatibility.
- 1. Open WPS Office Spreadsheets: Launch WPS Office and open a new or existing spreadsheet file.
- 2. Select the target range: Select the cells where you will paste or type hyphen-prefixed text.
- 3. Set the number format to Text: Right-click the selected range, click Format Cells, choose Text in the Number tab, and click OK.
- 4. Paste as text: Paste the data with Ctrl+Shift+V or Paste Special > Text so the leading hyphen remains plain text.
- 5. Verify the result: Check that the cells display the hyphen-prefixed text and no formula or #NAME? error appears.

Frequently Asked Questions
Why does Excel change text starting with a hyphen into a formula?
A leading hyphen or minus sign is interpreted as the beginning of a formula, so the application adds an equals sign and treats the rest as a function or name. When the name is not recognized, it returns #NAME?.
How do I paste hyphen-prefixed text into WPS Office without errors?
Select the destination cells, format them as Text through Format Cells > Number > Text, then paste with Paste Special > Text or Ctrl+Shift+V.
Does formatting cells as Text after pasting fix the #NAME? error?
No. Applying Text format after the fact does not convert existing formula entries back to text. You need to pre-format the cells before entry or re-enter the values.
How can I remove a hyphen from text that has already been entered?
Use a formula such as =SUBSTITUTE(A1,"-","") in a helper column, or select the data and use Data > Text to Columns with a suitable delimiter.




