← Level 4 – Sorter

7 / 12 ⏱ 22 minutes بريميوم

Nested KDYŽ

KDYŽ inside KDYŽ — more than two options.

One question is not enough

You know KDYŽ(B2>3;"practice";"ok"). What if you want three levels: super (1), ok (2), practice (3+)? Nested KDYŽ: in the “otherwise” place you put another KDYŽ.

=KDYŽ(B2=1;"super";KDYŽ(B2=2;"ok";"practice"))

English: =IF(B2=1,"super",IF(B2=2,"ok","practice"))

The Sorter marks data with this — the chart then shows only numbers, the text column tells you what to do with them.

Three levels for grades

  1. Sheet Znamky. In C1 write Status. C2 formula (Czech):

    =KDYŽ(B2=1;"super";KDYŽ(B2=2;"ok";"practice"))

  2. نسخ C2 to C6. Maths 2 → ok. English 3 → practice. History 1 → super.

  3. Change B4 from 3 to 1. C4 jumps to super. Nested KDYŽ reacts to the grade change.

  4. Sheet Kapesne. Column E Day status. E2:

    =KDYŽ(D2<0;"minus";KDYŽ(D2=0;"zero";"plus"))

    (D = Left after the day.) Drag down.

  5. Filter on column E: only minus — which days did you finish in minus?

💡

Keep nesting at max two levels (three results). More than three levels → VLOOKUP/XLOOKUP or a rules table is قريباً. Readability matters more than pride in one giant formula.

Order of conditions

Test from the most special. First =1, then =2, the rest practice. If you first did >2, a two would fall into “practice” wrongly.

For pocket money: first <0 (minus), then =0, otherwise plus.

What often goes wrong

Missing bracket. Every KDYŽ has three parts in (). Count the brackets in the formula bar.

Semicolon vs. comma. Czech account: ;. English: ,. When #NAME?, check the function language.

Text without quotes. super must be "super", otherwise the sheet looks for a cell named super.

🏫 Grade average — column C

Status next to the grade — the teacher sees the table and a word summary. The average stays in B8 from numbers, not from text C. Chart from B, not from C.

💰 Pocket money — minus days

Filter E = minus. How many such days? Later COUNTIF. Today a filter and eyes are enough.

📊 Class survey — categories

Nested KDYŽ: answer nothingno snack, otherwise with snack. A helper column before the summary — not instead of the summary table.

🏆 Mini dashboard — numbers only

The dashboard shows average and totals, not the Status column. Nested KDYŽ is for work on the Znamky/Kapesne sheet.

Now you 💪

First: column C on grades — three levels, copied formula.

Second: pocket money — minus/zero/plus. Filter on minus.

Check: Every grade 1–3 has the right text. Changing B2 changes C2. The brackets fit.

What to take from this lesson