Logical Functions
Advanced

IFS with a compound first test

The most specific case first, the general cases after.

Task:

Gym pricing: an adult (18 or over) who is a member pays Member; any other adult pays Adult; everyone under 18 pays Junior. In D2:D7 give each visitor's price band.

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 × 4 columns6 cells you fill in
ABCD
1VisitorAgeMemberBand
2V134Yes
3V217Yes
4V352No
5V418No
6V515No
7V618Yes
What this exercise teachesMay contain the answer

If the adult test came first, members would never reach the Member band — every member is also an adult. With IFS, as with nested IF, the specific cases go before the general ones. V2 is a member but under 18, so the AND fails and they fall through to Junior.