Module 5 · Logical · Zone codes

Priya Nair runs Lantern Fest, a small music festival

Every crew member gets a wristband with a zone code and a day number. Nobody remembers what the codes mean. Priya answers the same question all day. You translate the codes with SWITCH.

Loading the spreadsheet…

Module 5 · Logical

Zone codes

Priya Nair, runs Lantern Fest, a small music festival
Priya Nair runs Lantern Fest, a small music festival

Every crew member gets a wristband with a zone code and a day number. Nobody remembers what the codes mean. Priya answers the same question all day. You translate the codes with SWITCH.

Steps

  1. Translate a code with SWITCH

    SWITCH compares a value with a list of values. It gives back the result of the first match.

    How to do it

    1. Select the cell for the result.
    2. Type =SWITCH(
    3. Type the cell with the value and a comma.
    4. Type a pair: the match and the result. Type a comma.
    5. Type the other pairs and a closing bracket.
    6. Press Enter.

    =SWITCH(C5,"A","Backstage","B","Main stage","C","Camping")

    Task: Translate the other codes. Fill in D6:D12.

  2. Add a default value

    The last value of SWITCH can be a default. SWITCH gives it back if no value matches.

    How to do it

    1. Click cell F5.
    2. Type SWITCH with the value and the pairs. Type a comma.
    3. Type the default value and a closing bracket.
    4. Press Enter.
    5. Without a default, SWITCH gives #N/A if no value matches.

    =SWITCH(E5,1,"Friday",2,"Saturday",3,"Sunday","All days")

    Task: Translate the other day numbers. Fill in F6:F12.