Formula Errors

Fix the #NAME? Error in Excel IF and IFS Conditions

Camila MilosovichCamila Milosovich Nov 18, 2026 870 views

Question details

Fix a #NAME? error in an Excel IF or IFS formula that compares a cell with text.

Fix the #NAME? Error in Excel IF and IFS Conditions
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?.
Before you start

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.

Solution 1Recommended

Put text values in quotation marks

Use this fix when an IF or IFS condition compares a cell with literal text.

1
Inspect the condition

Select the formula cell and look in the formula bar for a test such as A4479=RJR.

2
Quote the text

Replace the test with A4479="RJR". For example, use =IFS(A4479=1,"Altria",A4479="RJR","RJR",TRUE,"Other") and press Enter.

3
Adapt the result values

In the formula bar, replace "Altria", "RJR", and "Other" with the results or formulas you need for each condition.

Put text values in quotation marks
Check the value type: If the condition should compare a numeric code, use the number without quotes, such as A4479=2. If RJR is intended to be a defined name, check it under Formulas > Name Manager instead.
Work with formulas in WPS Office

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. 1. Open the workbook: In WPS Spreadsheets, select Open and choose your Excel workbook.
  2. 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. 3. Check and save: Press Enter to check the result, then select File > Save to save the workbook.
Edit text comparisons and nested IF formulas in the formula barOpen and save Microsoft Excel XLSX filesWork with spreadsheets in a familiar interface
microsoft office alternative - wps office

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.