How to use IF with text in Excel
Formula (Excel and Google Sheets)
=IF(C2="Paid","Closed","Follow up")Compare the cell with the text in double quotes: =IF(C2="Paid","Closed","Follow up"). The comparison ignores upper and lower case.
- Result on the example
- one result per row in
D2, filled down toD7 - Works in
- Every current version
- Google Sheets
- Same formula
See it work
The formula is already in D2, filled down to D7. Change any input and the result updates, or edit the formula to experiment.
How it works
C2="Paid" is TRUE when the cell holds exactly that text, and IF returns "Closed"; otherwise it returns "Follow up". Text inside a formula always goes in double quotes, both in the test and in the results. The = comparison ignores case, so "paid" on INV-2043 matches too.
=IF(C2="Paid","Closed","Follow up")Result"Closed"
C2"Paid"The value in C2.
C2="Paid"TRUEThe = operator tests whether the two sides are equal.
IF(C2="Paid","Closed","Follow up")"Closed"IF: Returns one value if a test is true, another if false.- logical_test
C2="Paid"TRUE - value_if_true
"Closed" - value_if_false
"Follow up"not used
- logical_test
In Google Sheets
The same formula works in Google Sheets: =IF(C2="Paid","Closed","Follow up"). 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<>"Paid","Follow up","Closed") | Closed, Follow up, Closed… | The same test the other way round, with <> meaning "is not". |
| =IF(EXACT(C2,"Paid"),"Closed","Follow up") | Closed, Follow up, Follow up…Different result | EXACT is case-sensitive. Use it when "paid" and "Paid" mean different things. INV-2043 ("paid") shows Follow up. |
Common mistakes
- Text without quotes, as in
=IF(C2=Paid,…), returns #NAME? because Excel reads Paid as a name. - A trailing space ("Paid ") doesn't equal "Paid". Imported data often has one; compare
TRIM(C2)="Paid". - Wildcards don't work with =:
C2="Pa*"looks for the literal text "Pa*". Use COUNTIF or SEARCH for partial matches.
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.
Use IF with text
D2, show "Closed" when the status is Paid and "Follow up" for anything else. Fill down to D7.Questions
How do I check for one of two words?
Use OR: =IF(OR(C2="Paid",C2="Refunded"),"Closed","Follow up").
Can IF return a number instead of text?
Yes. Leave numbers and cell references unquoted: =IF(C2="Paid",0,B2) shows the balance still due.
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.