How to Fix #NAME? Error for Text Beginning with a Hyphen in Excel CSV
Question details
The user is experiencing a #NAME? error when opening a CSV file containing text entries that begin with a hyphen.

- 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.
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.
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.
Launch Excel and press 'Ctrl + O' or navigate to 'File' > 'Open' on the ribbon menu.
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'.
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'.
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'.
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'.

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. Launch WPS Spreadsheet: Open WPS Office and start the Spreadsheet application.
- 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. 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'.

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.




