Why does my IF formula with text return #NAME?
Formula (Excel and Google Sheets)
=IF(C2="Yes","Approved","Waiting")Text in a formula needs double quotes. =IF(C2=Yes,Approved,Waiting) fails; =IF(C2="Yes","Approved","Waiting") works.
- Result on the example
- one result per row in
D2, filled down toD6 - Works in
- Every current version
- Google Sheets
- Same formula
See it work
The formula is already in D2, filled down to D6. Change any input and the result updates, or edit the formula to experiment.
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.
=IF(C2="Yes","Approved","Waiting")Result"Approved"
C2"Yes"The value in C2.
C2="Yes"TRUEThe = operator tests whether the two sides are equal.
IF(C2="Yes","Approved","Waiting")"Approved"IF: Returns one value if a test is true, another if false.- logical_test
C2="Yes"TRUE - value_if_true
"Approved" - value_if_false
"Waiting"not used
- logical_test
In Google Sheets
The same formula works in Google Sheets: =IF(C2="Yes","Approved","Waiting"). We ran it in Google Sheets mode on the same data and it returns the same results.
Other ways to do it
Each one was run on the same example sheet.
| Formula | Result | When to use it |
|---|---|---|
| =IF(C2<>"Yes","Waiting","Approved") | Approved, 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.
Try it yourself
Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.
Why does my IF formula with text return #NAME
D2, show "Approved" when the manager column says Yes, otherwise "Waiting". Fill down to D6.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.
Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.