beginner 2 min read

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.

SB

Sheets Bootcamp

February 19, 2026 ยท Updated November 5, 2026

Reviewed by Ryan
Syntax
=IF(logical_expression, value_if_true, value_if_false)

Quick Answer

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

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

ParameterRequiredDescription
logical_expressionYesThe condition to evaluate. Must resolve to TRUE or FALSE.
value_if_trueYesThe value returned when the condition is TRUE. Can be a number, text, formula, or cell reference.
value_if_falseNoThe 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.

A
B
C
D
E
F
G
H
I
J
1
2
3
4
5
6
7
8
9
10
11
12
13
Plate
Level
Hours
Fee
KTR-118
P1
2
$6.00
MXN-402
P2
5
$15.00
JLB-733
P1
1
$3.00
QWE-905
P3
9
$27.00
HAS-260
P2
3
$9.00
VNO-581
P3
7
$21.00
DPR-344
P1
4
$12.00
ZUL-617
P2
6
$18.00
Result
B11

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 free

First 6 lessons free. No card needed. See plans

Keep going

Continue learning

Unit 2 is next. Get full access

Practice this in the app

Continue learning

Spot an error on this page? Tell us.

First 6 lessons free. No credit card required.

Start the course free
Continue learning

Cookie policy ยท Privacy policy