What is IF in Google Sheets?

IF evaluates a logical test and returns value_if_true when the test passes, otherwise value_if_false. It is the basic branching function for labels, safe division, and simple approvals before you reach for IFS or lookup tables.

When to use it

Use IF for binary decisions: pass or fail, tax or no tax, show a message when a cell is empty, or return a blank instead of an error.

When to skip it

Skip deep nested IF trees with many tiers. IFS, SWITCH, or an XLOOKUP table read better and are easier to audit.

How it works

  1. 1

    Write a condition that resolves to TRUE or FALSE, such as B2>100 or A2="Yes".

  2. 2

    Provide value_if_true: number, text in quotes, another formula, or a cell reference.

  3. 3

    Provide value_if_false for the else branch. Omitting it returns FALSE by default in some cases.

  4. 4

    Nest IF inside either branch for more than two outcomes, but stop before readability breaks.

  5. 5

    Combine IF with AND or OR when the test needs multiple checks in one expression.

  6. 6

    Drag the formula down a column so each row evaluates its own condition.

Examples in Google Sheets

Pass fail label

=IF(C2>=70, "Pass", "Fail") prints readable status beside each score.

Safe divide

=IF(B2=0, "", A2/B2) avoids #DIV/0! when the denominator can be zero.

Bonus flag

=IF(D2="Closed Won", E2*0.1, 0) pays commission only on won deals.

Build this without starting from a blank cell

Use a Better Sheets tool for IF, then watch a walkthrough when you want the full pattern.

Better Sheets resources

Common mistakes

  • Nesting ten IF levels instead of using IFS or a lookup table on a Settings tab.
  • Returning text numbers when the column should stay numeric for charts.
  • Forgetting quotes around text results, so Sheets treats words as range names.
  • Comparing text numbers to real numbers, so every test returns the false branch.
  • Using IF when conditional formatting or data validation would enforce the rule at entry.

Frequently asked questions

IF vs IFS?
IF handles one test with two outcomes. IFS chains many condition-result pairs in one function.
IF vs IFERROR?
IF tests logic you choose. IFERROR catches any formula error and returns a fallback.
Can IF return a blank?
Yes. Use "" as value_if_true or value_if_false to show an empty cell.
IF with AND or OR?
Wrap the condition: IF(AND(A2>0,B2="Yes"), "Go", "Wait").
IF on whole columns?
Array behavior may spill results down when the condition references full columns.
IF vs SWITCH?
IF suits comparisons and inequalities. SWITCH matches exact values against a list.
Why does IF show FALSE?
You may have omitted value_if_false and the test failed, returning the logical FALSE.
IF with dates?
Compare date cells directly or use DATE in the condition when building thresholds.

Related Tutorials

Watch how IF works

Browse more tutorials
Search Every Function in Google Sheets

Search Every Function in Google Sheets

Built a useful tool to filter Google Sheet formulas based on keywords.
Hardest Formula: SumIF | Addition Based on Dates / Values

Hardest Formula: SumIF | Addition Based on Dates / Values

Demystifying the SumIF Formula. Add up your values based on a condition,...
Advanced Coding in Google Sheets for Programmers

Advanced Coding in Google Sheets for Programmers

Add a Custom Menu Create Native-like Functions Get URL and Sheet ID's vi...
5 Ways To Use Google Sheets for Advanced Project Management

5 Ways To Use Google Sheets for Advanced Project Management

Here are 5 advanced ways to manage projects inside of Google Sheets Man...
Google Sheet Basics - The Absolute Basics

Google Sheet Basics - The Absolute Basics

Let's start at the basics of Google Sheets. Where every beginner spreads...
Add Title Case to Google Sheets

Add Title Case to Google Sheets

Discover the Ultimate Google Sheets Hack! Transform Text with Title Case...

Related blog posts

Guides that explain IF in more depth.

Browse the blog

Related glossary terms

Done reading about IF?

Membership unlocks 636+ tutorials, unlimited generators, and every template. Practical lessons. Zero fluff.

Need this once

Jump to a free tool or a single tutorial for this topic.

Learning Sheets for real

Unlock the full library, generators, and templates with membership.