[{"data":1,"prerenderedAt":48},["ShallowReactive",2],{"lesson-shell:logical\u002Fswitch:en":3},{"id":4,"who":5,"role":6,"image":7,"text":8},"switch","Priya Nair","runs Lantern Fest, a small music festival","\u002Fpersona\u002Fpriya.webp",{"none":9,"win":36,"mac":42},{"title":10,"story":11,"steps":12},"Zone codes","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.",[13,25],{"id":4,"title":14,"intro":15,"how":16,"example":23,"task":24},"Translate a code with SWITCH","SWITCH compares a value with a list of values. It gives back the result of the first match.",[17,18,19,20,21,22],"Select the cell for the result.","Type =SWITCH(","Type the cell with the value and a comma.","Type a pair: the match and the result. Type a comma.","Type the other pairs and a closing bracket.","Press Enter.","=SWITCH(C5,\"A\",\"Backstage\",\"B\",\"Main stage\",\"C\",\"Camping\")","Translate the other codes. Fill in D6:D12.",{"id":26,"title":27,"intro":28,"how":29,"example":34,"task":35},"default","Add a default value","The last value of SWITCH can be a default. SWITCH gives it back if no value matches.",[30,31,32,22,33],"Click cell F5.","Type SWITCH with the value and the pairs. Type a comma.","Type the default value and a closing bracket.","Without a default, SWITCH gives #N\u002FA if no value matches.","=SWITCH(E5,1,\"Friday\",2,\"Saturday\",3,\"Sunday\",\"All days\")","Translate the other day numbers. Fill in F6:F12.",{"title":10,"story":11,"steps":37},[38,40],{"id":4,"title":14,"intro":15,"how":39,"example":23,"task":24},[17,18,19,20,21,22],{"id":26,"title":27,"intro":28,"how":41,"example":34,"task":35},[30,31,32,22,33],{"title":10,"story":11,"steps":43},[44,46],{"id":4,"title":14,"intro":15,"how":45,"example":23,"task":24},[17,18,19,20,21,22],{"id":26,"title":27,"intro":28,"how":47,"example":34,"task":35},[30,31,32,22,33],1795376394842]