Logical Functions
Advanced

SWITCH(TRUE, …) for ranges

Switch on TRUE and each "match" becomes a condition.

Task:

Stock cover is labelled Critical below 3 days, Low below 7, OK below 30, and Overstock from 30. In C2:C7 give each item's label using SWITCH with TRUE as the value.

Interactive Spreadsheet

Hints

+5 XPno-hints bonus

Solve it on your own to keep the bonus. Each hint gets one step closer to the formula.

The data in this exercise

This is the grid you start with. Cell references in the task — B6, C2 — point at the row numbers and column letters below.

7 rows × 3 columns6 cells you fill in
ABC
1ItemDays of coverStatus
2Filters2
3Belts6.5
4Bearings14
5Gaskets30
6Valves3
7Seals45
What this exercise teachesMay contain the answer

Plain SWITCH can only test equality, which is useless for ranges. Switching on TRUE turns each match into a condition, so SWITCH behaves like IFS with a built-in default. Because the thresholds are "less than", the order runs from smallest to largest — the reverse of the >= bands elsewhere.