=IF(logical_expression, value_if_true, value_if_false) tests a condition and returns one value when it is TRUE and another when it is FALSE. For example, =IF(B2>=70, "Pass", "Fail") returns Pass when B2 is 85 and Fail when B2 is 60. Use "" as the last argument to leave the cell blank when the condition is not met.
IF Function in Google Sheets
Learn how to use the IF function in Google Sheets to return different values based on whether a condition is true or false.
Sheets Bootcamp
February 19, 2026 ยท Updated November 5, 2026
Table of Contents
=IF(logical_expression, value_if_true, value_if_false) Quick Answer
The IF function in Google Sheets tests a condition and returns one value when the condition is TRUE and another when it is FALSE. It is the foundation of all conditional logic in Sheets.
You use IF whenever a cellโs value should depend on some other value. Pass/fail labels, status indicators, tiered categories: anything where the output changes based on a condition starts with IF.
Syntax
=IF(logical_expression, value_if_true, value_if_false)
Parameters
| Parameter | Required | Description |
|---|---|---|
logical_expression | Yes | The condition to evaluate. Must resolve to TRUE or FALSE. |
value_if_true | Yes | The value returned when the condition is TRUE. Can be a number, text, formula, or cell reference. |
value_if_false | No | The value returned when the condition is FALSE. Can be a number, text, formula, or cell reference. |
If you omit value_if_false, Google Sheets returns FALSE by default when the condition is not met. You can pass an empty string "" to return a blank cell instead.
Try it yourself
Question 1 of 3
3 quick questions. No account needed.
In B11, use IF to return "Long" when the Hours in C5 are more than 4, and "Short" if not.
Examples
Basic pass/fail
Check whether a score in B2 meets a passing threshold of 70:
=IF(B2>=70, "Pass", "Fail")
If B2 contains 85, this returns โPassโ. If B2 contains 60, it returns โFailโ.
Nested IF for letter grades
Assign a letter grade based on a score in B2:
=IF(B2>=90, "A", IF(B2>=80, "B", IF(B2>=70, "C", "F")))
Google Sheets evaluates from left to right. A score of 82 fails the first condition (not >= 90), passes the second (>= 80), and returns โBโ. For more than three tiers, consider using IFS instead. Nested IF formulas get hard to read fast.
Conditional calculation
Apply a 10% discount when the order total in C2 exceeds $100:
=IF(C2>100, C2*0.9, C2)
If C2 is $150, this returns $135. If C2 is $80, it returns $80 unchanged.
Common Errors
Formula parse error A parse error means Sheets could not read the formula. Check that the condition, the true value, and the false value are separated by commas and that every quote and parenthesis is closed.
FALSE instead of a blank
Leaving out the third argument is not an error, because value_if_false is optional:
=IF(B2>=70, "Pass")
This works (returns FALSE when the condition fails), but it rarely produces the result you want. Include the third argument, or use "" to leave the cell blank.
#ERROR! from mismatched quotes If your text values contain quotes or apostrophes, the formula breaks. Wrap text values in double quotes and avoid unescaped characters inside them.
Tips
Use "" as the false value when you want the cell to appear blank instead of showing FALSE. This keeps your sheet clean, especially in columns where only some rows meet the condition.
When you find yourself nesting more than three IF functions, switch to IFS. It handles multiple conditions in a flat list, which is easier to read and debug.
You read it. Now type it.
Unit 1 of the course is free: 6 short lessons in a grid that checks every formula. They teach the Google Sheets skills you'll actually use.
Start the course freeFirst 6 lessons free. No card needed. See plans
Practice this in the app
Continue learningSpot an error on this page? Tell us.
Thanks. We'll fix it and update the page.