How to Use the IF Function in Google Sheets (with Examples, 2026)
The IF function returns one value when a condition is true and another when it’s false — the foundation of logic in spreadsheets. Here’s the syntax and the patterns you’ll actually use.
IF Syntax
=IF(logical_expression, value_if_true, value_if_false)
- logical_expression — a test that evaluates to TRUE or FALSE (e.g.,
A2>100). - value_if_true — what to return if the test is TRUE.
- value_if_false — what to return if the test is FALSE.
Wrap text outputs in double quotes; numbers and cell references don’t need them.
1. A Basic Example
Label orders as “Large” or “Small” based on amount in A2:
=IF(A2>100, "Large", "Small")
If A2 is over 100, the cell shows Large; otherwise Small.
A text comparison:
=IF(B2="Paid", "✓", "Follow up")
2. Leave a Cell Blank
Return nothing (an empty string) when the condition isn’t met:
=IF(A2>100, "Large", "")
3. Multiple Conditions: IFS (Cleaner Than Nesting)
When you have several tiers, IFS is easier to read than nested IFs. It checks conditions in order and returns the first match:
=IFS(A2>=90, "A", A2>=80, "B", A2>=70, "C", TRUE, "F")
The final TRUE, "F" acts as a catch-all “otherwise.”
4. Multiple Conditions: Nested IF
You can also nest IF inside IF (older approach, still works):
=IF(A2>=90, "A", IF(A2>=80, "B", IF(A2>=70, "C", "F")))
IFS is usually clearer once you have more than two levels.
5. Combine IF with AND / OR
- AND — all conditions must be true:
=IF(AND(A2>100, B2="Paid"), "Ship", "Hold")
- OR — any condition true:
=IF(OR(B2="VIP", A2>500), "Priority", "Standard")
6. Handle Blanks and Errors
- Check for an empty cell with
ISBLANK:
=IF(ISBLANK(A2), "Missing", A2)
- Catch errors from a calculation with
IFERROR(cleaner than wrapping IF):
=IFERROR(A2/B2, "—")
7. Troubleshooting
”Formula parse error”
Usually a missing comma, an unbalanced parenthesis, or curly “smart” quotes pasted from a doc. Retype the quotes directly in Sheets.
Text always returns the false value
String comparisons aren’t case-sensitive in IF, but stray spaces break exact matches. Use TRIM, or compare with =IF(TRIM(B2)="Paid", ...).
Nested IF getting unwieldy
Switch to IFS, or for value-to-result mapping consider SWITCH or a VLOOKUP against a small lookup table.
Related Google Sheets guides: How to use VLOOKUP · How to use the QUERY function · How to use conditional formatting · How to create a pivot table · How to remove duplicates
Ready to automate your busywork?
Carly schedules, researches, and briefs you—so you can focus on what matters.
See what people say
"Before Carly, I relied on a Calendly link, but the whole process felt impersonal and not very professional. Carly changed that by handling all the back-and-forth, so I'm no longer stuck in endless email threads trying to line up schedules.
Now Carly reaches out to candidates, shares my real-time availability, lets them pick a slot, then sends a Zoom link and drops it straight into my calendar. She sends reminders to both of us before each call, which has significantly reduced no-shows and last-minute confusion.
On top of scheduling, Carly acts like a full executive assistant, sending me my schedule the night before so I can prepare for each call. It reminds me of the old x.ai assistant, but Carly is noticeably smarter, faster, and better suited to my healthcare recruitment business."
