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
Write a condition that resolves to TRUE or FALSE, such as B2>100 or A2="Yes".
-
2
Provide value_if_true: number, text in quotes, another formula, or a cell reference.
-
3
Provide value_if_false for the else branch. Omitting it returns FALSE by default in some cases.
-
4
Nest IF inside either branch for more than two outcomes, but stop before readability breaks.
-
5
Combine IF with AND or OR when the test needs multiple checks in one expression.
-
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.
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
Search Every Function in Google Sheets
Advanced Coding in Google Sheets for Programmers
Google Sheet Basics - The Absolute Basics
Add Title Case to Google Sheets
Related blog posts
Guides that explain IF in more depth.
The Most Popular Google Sheet Tutorial on the IF() Formula
The IF() formula is a logical function that makes it easy for users to compare a certain value and an expected value. It takes a look at a value to see if basic conditions are met.
Read post →The Best Google Sheet Tutorial for Beginners on the IF() Formula
Dive into Google Sheets with our free beginner tutorials on the powerful =IF() formula. Practical applications, templates, and tools included!
Read post →How to Gain Confidence in Google Sheets
Boost your confidence, master formula usage and overcome errors in this step-by-step guide. Join us to demystify spreadsheets.
Read post →Related terms
IFS
IFS runs several condition-result pairs in order and returns the result for the first condition that is TRUE. It replaces long nested IF trees for tiered scoring, bonus bands, and SLA buckets where each step tests a comparison.
Read guide →IFERROR
IFERROR wraps another formula and returns value_if_error when the inner expression hits any error, including #N/A, #REF!, #VALUE!, and #DIV/0!. Use it for polished dashboards. Fix the root cause when the error signals bad data you should clean.
Read guide →SWITCH
SWITCH evaluates an expression against a list of case values and returns the result for the first match. A default value catches everything else. It cleans up nested IF chains when you compare one cell to many constants like status codes.
Read guide →Google Sheets formula syntax
Every formula starts with = followed by a function name and arguments in parentheses. Ranges use A1 notation, text sits in quotes, and operators like + and & combine values. Sheets recalculates when inputs change, so syntax errors show as #NAME? or #ERROR! in the cell.
Read guide →Done reading about IF?
Membership unlocks 600+ 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.