IF Function
The IF function in Google Sheets returns one value if a logical expression is TRUE and another if it is FALSE.
Syntax
IF(logical_expression, value_if_true, value_if_false)
Examples
- Basic IF Statement
Check if a number is greater than 10:
=IF(A1 > 10, "Yes", "No")
This will output ‘Yes’ if A1 is greater than 10, otherwise ‘No’.
- Nested IF Statements
Return ‘Excellent’, ‘Good’, or ‘Poor’ based on a score:
=IF(A1 > 90, "Excellent", IF(A1 > 75, "Good", "Poor"))
This will output ‘Excellent’ if A1 is greater than 90, ‘Good’ if greater than 75, otherwise ‘Poor’.
Notes
- The IF function is essential for applying logic in your spreadsheet.
- It can be nested to handle multiple conditions.