Lesson 8. IF, AND, OR: decisions inside a cell
Use the file lesson08.xlsx.
Files: lesson08.xlsx · solutions: lesson08-solutions.xlsx.
In the exercises with a sheet, type the formula in the fx bar and click Check: the sheet works it out the way Excel does, with commas between the arguments (semicolons work too), and also tries it with other data, to see whether it still works when the data changes. In the other exercises, you work in Excel with the lesson's file and type the result here.
At the end of the page you'll find the lesson's Bonus challenge: one more exercise, whose answer isn't in the book. You check it only here.
Exercise 1
Show the answer
=IF(B4<C4,"Order","OK"): 4 items, Blue pens, Notebooks, Highlighters and Glue sticks (the erasers, with 25 for a minimum of 25, are not below the minimum).
Exercise 2
"", two quotes with nothing between them, is an empty text). Copy it down to E10. Which items show "Warning"?Show the answer
=IF(OR(B4=0,B4>100),"Warning",""): Pencils (120) and Highlighters (0).
Exercise 3
Show the answer
With the limit at $300.00, 6 orders get a discount (all except Zeta LLC and Theta Inc.), and the total of the discounts rises to $194.50.
Exercise 4
=IF(AND(B2>=18,C2="Yes"),"Accepted","Declined") return?Show the answer
"Declined": the first condition is true, the second is not, and AND needs both to be true.
Bonus challenge
The answer isn't in the book: you check it only here.
Show the answer
=IF(B4=0,"Urgent",IF(B4<C4,"Order","OK")), copied down to F10. The test for 0 has to come first: a stock of 0 is always below the minimum, so if you test B4<C4 first, the highlighters end up as "Order" and "Urgent" never shows. Result: the highlighters show Urgent, 3 items show "Order" (blue pens, notebooks and glue sticks) and the others show "OK".