Formula Errors

Prevent Excel from Treating Hyphen-Prefixed Text as a Formula in WPS Office

Khadija KhanKhadija Khan Nov 13, 2026 868 views

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?.

Prevent Excel from Treating Hyphen-Prefixed Text as a Formula in WPS Office
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 you start

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.

Solution 1Recommended

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.

1
Select the destination cells

Open your WPS Office spreadsheet and select the cells or range where the hyphen-prefixed text will be pasted.

2
Open Format Cells

Right-click the selected range and choose Format Cells, or press Ctrl+1.

3
Apply Text format

In the Number tab, select Text and click OK.

4
Paste the values

Paste the copied text. Use Paste Special > Text or press Ctrl+Shift+V to paste values without source formatting.

Pre-format destination cells as Text before pasting
Result: Hyphen-prefixed entries remain visible as text and no #NAME? error appears.
WPS Spreadsheets

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. 1. Open WPS Office Spreadsheets: Launch WPS Office and open a new or existing spreadsheet file.
  2. 2. Select the target range: Select the cells where you will paste or type hyphen-prefixed text.
  3. 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. 4. Paste as text: Paste the data with Ctrl+Shift+V or Paste Special > Text so the leading hyphen remains plain text.
  5. 5. Verify the result: Check that the cells display the hyphen-prefixed text and no formula or #NAME? error appears.
Prevents #NAME? errors when entering hyphen-prefixed textPreserves leading hyphens or minus signs as literal textFull compatibility with Microsoft Excel XLSX filesFree and lightweight spreadsheet editingFamiliar ribbon and Format Cells workflow
QA img-9

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.