cellio

IF Function in Google Sheets: Examples for Every Case

How to use IF in Google Sheets: text and number tests, blanks, AND/OR, nested IF and IFS, and applying IF to a whole column with ARRAYFORMULA.

By Ayoub Farid · · 1 min read

IF works the same in Google Sheets as in Excel: test something, return one value if true and another if false.

Syntax

=IF(logical_expression, value_if_true, value_if_false)

Examples

=IF(B2>=50,"Pass","Fail")
=IF(C2="Paid","✓","Chase")
=IF(B2="","",B2*1.2)
=IF(B2>C2,B2-C2,0)

Several conditions

=IF(AND(B2>=50,C2="Submitted"),"Pass","Fail")
=IF(OR(D2="Late",E2="Missing"),"Review","OK")

See AND and OR.

More than two outcomes

=IFS(B2>=90,"A",B2>=80,"B",B2>=70,"C",TRUE,"F")

Or nested IF, or SWITCH for exact values. See IFS and nested IF.

A whole column with one formula

Instead of filling down, Sheets can apply IF to every row:

=ARRAYFORMULA(IF(B2:B="","",IF(B2:B>=50,"Pass","Fail")))

The outer IF leaves empty rows blank. See ARRAYFORMULA.

Checkboxes

Insert > Checkbox makes cells TRUE/FALSE, perfect for IF:

=IF(A2,"Done","To do")

Common mistakes

  • Text without quotes → #NAME?
  • Numbers in quotes (">50" inside IF compares text) → write B2>50
  • Wrong order in nested IFs → test the strictest condition first

Full guide: IF function.

Frequently asked questions

How do I write an IF formula in Google Sheets?

=IF(test,"value if true","value if false").

How do I use IF with multiple conditions?

Combine with AND/OR, nest IFs, or use IFS.

How do I apply IF to a whole column?

Wrap it in ARRAYFORMULA with open-ended ranges like B2:B.

Does Google Sheets have IFS?

Yes.

Keep reading