How to Fix Excel IF Formula Returning an Error Instead of a Blank
Question details
The user needs to fix an Excel IF formula that is returning a #NAME? error instead of displaying a blank cell as intended.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- The user copied or typed an IF formula designed to output an empty string when a condition is false, but the formula breaks due to formatting issues.
- Observed behavior
- The formula returns a #NAME? error because it contains nonstandard curly quotation marks instead of the required standard straight quotation marks.
Double-check your formula bar to see if the quotation marks around your text or empty strings appear slanted or curly, which typically happens when copying formulas from Word documents, emails, or web pages.
Replace Curly Quotation Marks with Straight Quotation Marks
Replace any stylized or curly quotation marks in your formula with standard straight quotes directly from your keyboard to resolve the #NAME? error.
Excel requires standard straight quotation marks to recognize text strings or empty values. Rich text environments often automatically convert these into smart or curly quotes ( “ ” ). When pasted into Excel, these invalid characters trigger a #NAME? error because Excel attempts to read them as an undefined function or named range.
Select the cell displaying the #NAME? error and click inside the Formula Bar at the top of the worksheet.
Find the curly quotation marks in your IF formula (for example, looking like “” instead of "") and delete them.
Type standard straight quotation marks ( "" ) directly using your keyboard for the false-result argument. Press Enter to apply the fix.
Click the bottom-right corner of the corrected cell and drag the fill handle down to apply the functioning formula to the rest of the column.

Use WPS Spreadsheet to Handle Complex Formulas
WPS Spreadsheet offers a powerful and highly compatible environment for data analysis, supporting all standard Excel functions including IF, IFERROR, and VLOOKUP. It seamlessly handles formula editing and helps you easily spot syntax errors like invalid quotation marks.
- 1. Open your file in WPS Spreadsheet: Launch WPS Office and open your .xlsx or .csv file containing the formula errors.
- 2. Edit the formula: Select the cell with the error, navigate to the formula bar, and replace the curly quotes with standard straight quotes using your keyboard.
- 3. Auto-fill the column: Hover over the bottom-right corner of the cell and drag the fill handle down to effortlessly apply the fixed IF formula to your entire dataset.

Frequently Asked Questions
Why does Excel show a #NAME? error for simple formulas?
A #NAME? error usually means Excel doesn't recognize text in the formula. This often happens if you misspell a function name, forget to wrap text strings in quotes, or use nonstandard characters like curly quotation marks instead of standard straight quotes.
How can I prevent curly quotes when copying formulas from the internet?
When copying formulas from a web page or a Word document, paste the text into a plain text editor like Notepad first. This strips away rich text formatting and converts curly quotes back to standard straight quotes before you copy and paste them into your spreadsheet.
What is the correct way to output a blank cell using the IF function?
To output a blank cell, use two standard straight quotation marks with no space between them (""). For example, =IF(A1>10, "Yes", "") will return a blank cell if the value in A1 is 10 or less.
Does WPS Spreadsheet support the same IF function syntax as Microsoft Excel?
Yes, WPS Spreadsheet is fully compatible with Microsoft Excel's formula syntax. The IF function and nested IF statements work exactly the same way, including how they handle blank cells and text strings.




