# Why does my IF formula with text return #NAME?

Text in a formula needs double quotes. =IF(C2=Yes,Approved,Waiting) fails; =IF(C2="Yes","Approved","Waiting") works.

**Excel:** `=IF(C2="Yes","Approved","Waiting")` (Every current version)

**Google Sheets:** the same formula works.

## Example

Sample data (row 1 is the header):

| A | B | C | D |
| --- | --- | --- | --- |
| Employee | Days | Manager OK? | Status |
| Kim | 3 | Yes |  |
| Raj | 1 | No |  |
| Lee | 5 | Yes |  |
| Ola | 2 | Pending |  |
| Max | 4 | Yes |  |

Formula in D2, filled to D6: `=IF(C2="Yes","Approved","Waiting")`

Result: Approved; Waiting; Approved; Waiting; Approved

## How it works

Without quotes, `=IF(C2=Yes,Approved,Waiting)` asks for things named Yes, Approved and Waiting. No such names exist, so the result is #NAME?. In double quotes they are text values, and the formula compares and returns words as intended.

## Other ways

- `=IF(C2<>"Yes","Waiting","Approved")`: The same test from the other side.

## Common mistakes

- Curly quotes pasted from Word or email (“Yes”) aren't formula quotes and also cause errors. Retype them in the formula bar.
- Numbers don't need quotes. `B2="5"` compares with the text "5", which the number 5 doesn't equal.
- TRUE and FALSE are logical values, not text, so leave them unquoted as well.

## Questions

**How do I put a quote mark inside the text?**

Double it: `="He said ""yes"""` shows He said "yes".

**Do Google Sheets formulas need quotes too?**

Yes, the same rule: text in double quotes, numbers and cell references without.

Every formula and result on this page was checked by running it in the Spreadsheet Practice formula engine on 2026-10-30.

Source: https://spreadsheetpractice.com/formulas/if-formula-with-text-returns-name-error
