Spreadsheet Practice

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 to D7
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"

  1. C2"Paid"

    The value in C2.

  2. C2="Paid"TRUE

    The = operator tests whether the two sides are equal.

  3. IF(C2="Paid","Closed","Follow up")"Closed"

    IF: Returns one value if a test is true, another if false.

    • logical_testC2="Paid"TRUE
    • value_if_true"Closed"
    • value_if_false"Follow up"not used

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.

FormulaResultWhen 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 resultEXACT 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

In 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.