A question, yes, no
The IF function can make decisions. It asks a question and, depending on the answer, writes one thing or the other.
=IF(question, if yes, if no)
An example: “Is the grade worse than 2? If yes, write practice. If no, write ok.”
=IF(B2>2,"practice","ok")
The parts of the formula
B2>2is the question. Is the grade bigger than 2?"practice"gets written when the answer is yes."ok"gets written when the answer is no.- Text always goes in quotation marks.
- The parts are separated with a comma
,.
Comparing
| Sign | Means |
|---|---|
> | greater than |
< | less than |
>= | greater than or equal to |
<= | less than or equal to |
= | equal to |
<> | not equal to |
The “Next step” column
-
On the
Gradessheet, typeNext stepin C1. -
In C2, type
=IF(B2>2,"practice","ok"). -
Drag C2 down to C6.
-
Spanish (3) says
practice, the others sayok. -
Change Math to 4.
practiceshows up next to Math.
If the formula doesn’t work, check:
- the quotation marks around the text,
- the commas (in some countries’ settings, it’s semicolons),
- the spelling of IF.
Pocket money
On the Money sheet, type Status in F1, and =IF(D2<0,"minus","fine") in F2. Drag it down to F8. You can see right away when you were in the minus.
دورك 💪
Gradeshas aNext stepcolumn.Moneyhas a column that watches for minus days.- When you change a number, the word changes.
Done when: the spreadsheet writes words based on the numbers by itself.
What to take away from this lesson
- IF = a question, yes, no.
- Text in quotation marks.
- A comma between the parts.
>greater,<less.
© 2026 Ing. Martin Polak / AlgoRhino · شروط استخدام المحتوى