IFS and SWITCH practice exercises
Choose between more than two outcomes without stacking IF inside IF: IFS for a list of tests, SWITCH for a list of exact values.
- 1Grades with IFSGrade the score in B2 with IFS: 90 or more is "A", 70 or more is "B", and anything else is "C". Use TRUE as the last test.
- 2Shipping price bands with IFSPremiumShipping costs 45 up to 1 kg, 69 up to 5 kg and 110 for anything heavier. In C2, use IFS to find the price for the weight in B2.
- 3Turn codes into names with SWITCHPremiumIn C2, use SWITCH to turn the code in B2 into a name: "N" is "North", "S" is "South", and any other code is "Other".
- 4Commission rates with IFSPremiumReps earn 10% commission on sales of 10,000 or more, 5% from 5,000 and nothing below that. In C2, multiply the sales in B2 by the rate IFS picks: B2*IFS(B2>=10000,0.1,B2>=5000,0.05,TRUE,0).