IF Function – Google Sheets

IF Function Summary

Function Type: Logical

The IF function returns one value if a logical expression is `TRUE` and another if it is `FALSE`.

IF Function Google Sheets Animation - Simplify Sheets

IF Function Purpose

IF function is a logical function that enables your formulas to return values dependent if the IF statement is true or false.

IF Function Syntax

Elements of the function

=IF(logical_expression, value_if_true, value_if_false)
  • Function name
  • logical_expression- [Required] The expression or cell reference to be tested if true or false
  • value_if_true- [Required] The value the function returns if logical_expression is true
  • value_if_false- [Required] The value the function returns if logical_expression is false

Arguments of the function

The IF function returns a value depending if the logical_expression is true or false.

IF Notes

  • Ensure that value_if_true and value_if_false are provided in the correct order.
  • Nesting IF functions can expand your formula, review our practice sheet. IFS function is a more efficient way to include multiple if statements. However, nesting functions is a concept that is used throughout this site to expand our functions.
  • Leaving the value_if_true or the value_if_false empty in your function will return nothing leaving the cell empty if the logical expression is set to return that value. =IF(A7="",,"Not Blank Cell")

IF Example Spreadsheet

Keyboard Shortcuts

Control (Ctrl) + Shift (⇧) + ArrowCommand (⌘) + Shift (⇧) + Arrow
Purpose: Highlight all cells in a columnPurpose: Highlight all cells in a column or row

Related Functions

  • IFERROR: Returns the first argument if it is not an error value, otherwise returns the second argument if present, or a blank if the second argument is absent.
  • IFS: Evaluates multiple conditions and returns a value that corresponds to the first true condition.
  • ISBLANK: Checks whether the referenced cell is empty.