Excel Error Codes

How to Fix #NAME? Error for Text Beginning with a Hyphen in Excel CSV

John WilsonJohn Wilson Oct 15, 2026 869 views

Question details

The user is experiencing a #NAME? error when opening a CSV file containing text entries that begin with a hyphen.

How to Fix #NAME? Error for Text Beginning with a Hyphen in Excel CSV
Product
Microsoft Excel
Device & OS
not provided
Scenario
Opening a CSV file directly in Excel where some data cells begin with a hyphen or minus sign.
Observed behavior
Excel incorrectly interprets the text starting with a hyphen as a formula, resulting in a #NAME? error despite the CSV data itself being correct.
Before you start

Open your CSV file in a basic text editor like Notepad first to verify that the original data is correct and the hyphens are indeed part of your uncorrupted text.

Solution 1Recommended

Use the Text Import Wizard to Format Columns as Text

Import the CSV file manually instead of opening it directly by double-clicking. This allows you to stop Excel from evaluating hyphens as formulas.

When you double-click a CSV file, Excel uses its default data formatting rules. By manually using the Text Import Wizard, you can force Excel to read specific columns as plain text, preserving the hyphenated values without triggering an error.

1
Open the File Dialog

Launch Excel and press 'Ctrl + O' or navigate to 'File' > 'Open' on the ribbon menu.

2
Locate and Select the CSV File

In the Open dialog, change the file type dropdown menu at the bottom right to 'Text Files (*.txt, *.prn, *.csv)'. Browse to your CSV file, select it, and click 'Open'.

3
Start the Text Import Wizard

The Text Import Wizard window will appear automatically. Under 'Choose the file type that best describes your data', select the 'Delimited' option and click 'Next'.

4
Set the Comma Delimiter

In the Delimiters section, check the box for 'Comma' (and uncheck others if necessary). You should see your data align into columns in the preview pane. Click 'Next'.

5
Format the Column as Text

In the Data preview window, click on the header of the column containing the hyphenated text. Under the 'Column data format' section in the upper right, select 'Text'. Repeat this for any other affected columns, then click 'Finish'.

Use the Text Import Wizard to Format Columns as Text
Data Integrity Preserved: By formatting the column as Text during the import process, Excel will display the hyphenated text exactly as it appears in the original CSV file without attempting to calculate it as a formula.
Seamless CSV Import

Easily Import and Manage CSV Files with WPS Spreadsheet

Avoid frustrating formula evaluation errors by using WPS Office to import your CSV files safely. WPS Spreadsheet offers a powerful and intuitive data import tool that gives you full control over how your text and numbers are formatted upon opening.

  1. 1. Launch WPS Spreadsheet: Open WPS Office and start the Spreadsheet application.
  2. 2. Initiate Data Import: Navigate to the 'Data' tab on the top ribbon and select 'Import Data', or simply click 'File' > 'Open' to select your CSV.
  3. 3. Configure Text Format: In the File Conversion or Text Import prompt, select 'Delimited', choose 'Comma', and set the specific column format to 'Text' before clicking 'Finish'.
Fully compatible with Microsoft Excel (.xlsx, .xls, .csv) formatsIntuitive Text Import Wizard for error-free data formattingLightweight application with rapid file loading speedsFree to use with a clean, user-friendly interface
microsoft office alternative - wps office

Frequently Asked Questions

Why does Excel think my hyphenated text is a formula?

Excel is programmed to recognize certain leading characters—such as equals (=), plus (+), minus or hyphen (-), and at (@)—as the beginning of a calculation. If the text following a hyphen isn't a valid function or cell reference, Excel fails to calculate it and throws a #NAME? error.

Can I stop Excel from formatting hyphens automatically without using the import wizard?

If you are typing the data manually into Excel, you can type an apostrophe (') before the hyphen (e.g., '-text). The apostrophe is a special prefix that tells Excel to treat the cell contents strictly as plain text, preventing formula evaluation.

Does saving the CSV file fix the #NAME? error?

No. The #NAME? error is an interpretation issue within Excel. If you save the file while it displays #NAME?, Excel may permanently overwrite your original hyphenated text with the literal error string. Always fix the import formatting before saving.

Is there a more modern way to automate text formatting for CSV files in Excel?

Yes. You can use Power Query by going to 'Data' > 'From Text/CSV'. This opens a preview window where you can click 'Transform Data' to access the Power Query Editor. There, you can explicitly define data types for each column (changing them to Text) before loading the data into your worksheet.