Fix the #NAME? Error in Excel IF and IFS Conditions
Question details
Fix a #NAME? error in an Excel IF or IFS formula that compares a cell with text.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- The user is combining conditions that test whether cell A4479 contains a numeric code or the text RJR.
- Observed behavior
- Excel interprets unquoted RJR as a name rather than a text value and returns #NAME?.
Select the cell showing #NAME? and inspect its formula in the formula bar. Check whether RJR is intended to be literal text, a numeric code, or a defined name.
Put text values in quotation marks
Use this fix when an IF or IFS condition compares a cell with literal text.
Select the formula cell and look in the formula bar for a test such as A4479=RJR.
Replace the test with A4479="RJR". For example, use =IFS(A4479=1,"Altria",A4479="RJR","RJR",TRUE,"Other") and press Enter.
In the formula bar, replace "Altria", "RJR", and "Other" with the results or formulas you need for each condition.

Use nested IF statements when IFS is unavailable
Use nested IF if your Excel version does not support the IFS function.
Correct IF conditions in WPS Spreadsheets
Open your workbook in WPS Spreadsheets and use quoted text and nested IF conditions to avoid treating a text value as a name.
- 1. Open the workbook: In WPS Spreadsheets, select Open and choose your Excel workbook.
- 2. Edit the formula: Select the formula cell and replace an unquoted text test such as A4479=RJR with A4479="RJR" in the formula bar.
- 3. Check and save: Press Enter to check the result, then select File > Save to save the workbook.

Frequently Asked Questions
Why does A4479=RJR return #NAME? in Excel?
Excel treats unquoted RJR as a name. If RJR is literal text, change the condition to A4479="RJR" in the formula bar.
Do numbers need quotation marks in an IF condition?
No. To compare A4479 with the number 2, use A4479=2. Use quotation marks only if you intend to compare it with the text value "2".
What can I use if Excel does not support IFS?
Use nested IF statements instead. For example, enter =IF(A4479=1,"Altria",IF(A4479="RJR","RJR","Other")) in the formula bar.
How do I check whether RJR is a defined name?
In Excel, open Formulas > Name Manager and look for RJR. If it is not defined and you mean the text value, put RJR in double quotation marks.




