Pepelen
← Google Sheets from Scratch: Formulas, QUERY, and Collaboration

Lesson

Lesson 1: IF, IFS, and nested conditions

Build IF formulas (if-then-else) and replace clunky nested IFs with IFS.

1 / 6

How IF works and when you need IFS

How IF works and when you need IFS

The IF function is the foundation of conditional logic in Google Sheets. Syntax: =IF(condition, value_if_true, value_if_false). Arguments are separated by commas. The condition is any comparison: A2>90, B3="Moscow", C5<>0. Comparison operators: > (greater than), < (less than), >= (greater than or equal to), <= (less than or equal to), = (equal to), <> (not equal to). Example: =IF(B2>=60, "Passed", "Failed") — if the score in B2 is at least 60, the cell shows “Passed”; otherwise, “Failed”. Text values in the result go in double quotes; numbers go without quotes. When you need to check several conditions in turn, you write nested IFs: =IF(A2>=90, "Excellent", IF(A2>=75, "Good", IF(A2>=60, "Fair", "Poor"))). With three or more branches, this becomes unreadable and easily leads to mistakes with closing parentheses. That’s exactly what IFS is for: =IFS(condition1, value1, condition2, value2, ...). The function checks the “condition — result” pairs in order and returns the first matching result. An example with a discount tier: =IFS(C2>=10000, "Gold", C2>=5000, "Silver", C2>=1000, "Bronze", TRUE, "No discount"). The last pair, TRUE, is the default result if no condition is met.
Lesson notes
How IF works and when you need IFS
The IF function is the foundation of conditional logic in Google Sheets. Syntax: =IF(condition, value_if_true, value_if_false). Arguments are separated by commas. The condition is any comparison: A2>90, B3="Moscow", C5<>0. Comparison operators: > (greater than), < (less than), >= (greater than or equal to), <= (less than or equal to), = (equal to), <> (not equal to). Example: =IF(B2>=60, "Passed", "Failed") — if the score in B2 is at least 60, the cell shows “Passed”; otherwise, “Failed”. Text values in the result go in double quotes; numbers go without quotes. When you need to check several conditions in turn, you write nested IFs: =IF(A2>=90, "Excellent", IF(A2>=75, "Good", IF(A2>=60, "Fair", "Poor"))). With three or more branches, this becomes unreadable and easily leads to mistakes with closing parentheses. That’s exactly what IFS is for: =IFS(condition1, value1, condition2, value2, ...). The function checks the “condition — result” pairs in order and returns the first matching result. An example with a discount tier: =IFS(C2>=10000, "Gold", C2>=5000, "Silver", C2>=1000, "Bronze", TRUE, "No discount"). The last pair, TRUE, is the default result if no condition is met.
Lesson 1: IF, IFS, and nested conditions — Google Sheets from Scratch: Formulas, QUERY, and Collaboration