← Level 4 – Sorter

2 / 12 ⏱ 22 minutes 高级版

KDYŽ — the table decides

When a grade is worse than 3, write “practice”.

Question, yes, no

KDYŽ (in English IF) is a sentence: when this is true, write this, otherwise that.

Three parts in the brackets. The order is sacred.

  1. A question that can be true or not. For example B2>3.
  2. What to write when it is true.
  3. What to write when it is not true.

Czech:

=KDYŽ(B2>3;"practice";"ok")

English:

=IF(B2>3;"practice";"ok")

A semicolon ; splits the parts in Czech Excel and in many Sheets. Some English accounts want a comma ,:

=IF(B2>3,"practice","ok")

When the formula shouts #CHYBA! or the sheet claims the function does not exist, try the other language and the other separator. It is not a mistake in your head. It is the language of the account.

💡

Comparisons: > greater, < smaller, >= at least, <= at most, = equals, <> not equal. Compare text in quotes: B2="apple". Numbers without quotes: B2>3. B2="3" is a different question — you are asking about a text three.

A decision column for grades

Let the table write by itself where practice is needed. You write the formula once.

Imagine Znamky:

ABC
1SubjectGradeWhat to do
2Maths2ok
3Czech1ok
4English5practice
5Science3ok
6History4practice

C2 and down is calculated by the formula. You do not type “practice” there by hand.

  1. On Znamky in C1 write What to do and make it bold. That is the heading of the new column, not a formula.

  2. In C2 write =KDYŽ(B2>3;"practice";"ok") (or IF). Enter. For Maths 2 you must see ok. If you see the formula itself as text, the = is missing or column C is formatted as text.

  3. Click C2. The little square at the bottom right. Drag down to all the grades, for example to C6. Do not copy into the average row. Average 1.8 is not a subject and “ok” next to it is confusing.

  4. Click C4. In the formula bar you must see =KDYŽ(B4>3;"practice";"ok"). The row moved. That is what you want. The question asks about B4, not always about B2.

  5. Change B4 to 5. C4 must jump to practice without editing the formula. Change it back to 3. C4 is ok. The table decided. You wrote the formula once.

⚠️

#HODNOTA! / #VALUE! with KDYŽ usually means you are comparing text with a number. In B2 there is 5 with a space, or the word five. Rewrite the cell to a bare number. If you see #NÁZEV? / #NAME?, the account does not know KDYŽ — try IF.

Second job: pocket money

The same sentence, a different question. Spending bigger than income?

On Kapesne have columns B = came in, C = you spent. In E1 write Watch. In E2:

=KDYŽ(C2>B2;"overspending";"all good")

English IF the same way.

Example: B2 is 50, C2 is 20. The question 20>50 is false. E2 shows all good.
B3 is 0, C3 is 15. The question 15>0 is true. E3 shows overspending.

Drag down only across the days. Not across the total at the bottom. A total of spending is not a day and the watch next to it lies.

🏫 Grades — practice

Change one grade to 5. In C, practice must appear. Change it to 2 — ok. If C does not move, the formula is not looking at that cell: either you did not drag it this far, or in C there is no formula, just a word typed by hand. Click C. The formula bar must start with =.

💰 Pocket money — watch

Seven days, column E. One KDYŽ sentence. When you see overspending on a day when you really spent more than came in, the table is doing the work for you. You do not have to compare the columns with your eyes.

What you should see after Enter

C2 after =KDYŽ(B2>3;"practice";"ok") shows a word, not the formula. You click C2 — at the top the formula lights up. That is the right pair: the cell speaks English, the formula bar calculates.

When B2 is 2, C2 is ok.
When B2 is 3, C2 is ok — the question is worse than 3, a three still passes.
When B2 is 4, C2 is practice.

If you want a three as practice too, the question is B2>=3. Read it out loud before you change it. One extra equals sign changes the whole column.

What often goes wrong

Missing quotes. =KDYŽ(B2>3;practice;ok) looks for names. You get #NÁZEV?. Put "practice" and "ok".

Wrong separator. A comma in a Czech account: the sheet thinks 3,"practice" is one number. Use a semicolon, or the other way a comma, according to the hint.

KDYŽ across the average. C8 shows ok next to 1.8. It looks like another subject. Drag only to the last grade.

Question upside down. B2<3 marks ones and twos as practice. With grades, worse is a bigger number. Read the question out loud: “Is the grade worse than a three?”

Text instead of a number. B2="5" is true only when B2 is text. Write the grade as a number and ask B2=5 or B2>3.

Now you 💪

Two tables, two formulas.

First: column C on Znamky with KDYŽ / IF. One five must say practice. One two ok. Leave the average row empty.

Second: column E on Kapesne: =KDYŽ(C2>B2;"overspending";"all good"). On a day where spending is bigger than income, the first text must light up. Change C2 to a bigger number and watch E2 flip.

When the formula shouts, first the language (KDYŽ vs IF), then semicolon vs comma, then whether B has a number.

Check: The formula in C2 starts with =KDYŽ or =IF. On every row a different decision according to the number in B. In the formula bar there are quotes around the text.

What to take from this lesson