# How to use IF with text in Excel

Compare the cell with the text in double quotes: =IF(C2="Paid","Closed","Follow up"). The comparison ignores upper and lower case.

**Excel:** `=IF(C2="Paid","Closed","Follow up")` (Every current version)

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

## Example

Sample data (row 1 is the header):

| A | B | C | D |
| --- | --- | --- | --- |
| Invoice | Amount | Status | Action |
| INV-2041 | 1250 | Paid |  |
| INV-2042 | 830 | Unpaid |  |
| INV-2043 | 2400 | paid |  |
| INV-2044 | 615 | Overdue |  |
| INV-2045 | 1980 | Paid |  |
| INV-2046 | 370 | Unpaid |  |

Formula in D2, filled to D7: `=IF(C2="Paid","Closed","Follow up")`

Result: Closed; Follow up; Closed; Follow up; Closed; Follow up

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

## Other ways

- `=IF(C2<>"Paid","Follow up","Closed")`: The same test the other way round, with <> meaning "is not".
- `=IF(EXACT(C2,"Paid"),"Closed","Follow up")`: 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.

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

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-cell-equals-text
