Some rules have several ways to qualify, and meeting any one of them is enough. OR is TRUE when at least one of its conditions is, so inside an IF it turns a list of exemptions into a single test that charges only the people none of them cover.
You work the counter at a pharmacy, and the morning's prescriptions are in A2:D9 with each patient's age, whether they showed an exemption certificate and how many items are on the prescription. Each item costs the charge per item in G2, unless the patient is exempt, and they are exempt if any one of these is true: they are under 16, they are 60 or over, or they have a certificate. A patient who is exactly 16 pays; one who is exactly 60 does not. In E2, write a formula that returns the amount the first patient pays, 0 if they are exempt, then copy it down to E9.
Solve it on your own to keep the bonus. Each hint gets one step closer to the formula.
This is the grid you start with. Cell references in the task — B6, C2 — point at the row numbers and column letters below.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Patient | Age | Certificate | Items | Amount due | Charge per item | |
| 2 | R. Okafor | 15 | No | 1 | 9.9 | ||
| 3 | J. Whitfield | 16 | No | 2 | |||
| 4 | M. Haddad | 59 | Yes | 1 | |||
| 5 | S. Lindqvist | 60 | No | 3 | |||
| 6 | P. Moreno | 42 | No | 1 | |||
| 7 | A. Kowalski | 34 | Yes | 2 | |||
| 8 | T. Brennan | 71 | No | 1 | |||
| 9 | L. Nguyen | 28 | No | 2 |
An exemption list is a set of alternatives: a patient does not have to be young and old and hold a certificate, they only need one of the three. That is exactly what OR means. OR(B2<16,B2>=60,C2="Yes") checks all three conditions and is TRUE if any of them is, so it answers one question, "is this patient exempt?", and IF turns that answer into money: 0 when it is TRUE, D2*$G$2 when it is FALSE. Writing it with AND instead would ask for all three at once, which nobody can meet, since no one is both under 16 and 60 or over, and every patient would be charged. The two boundary rows are there on purpose. J. Whitfield is exactly 16, and 16 is not under 16, so B3<16 is FALSE and, with no certificate, they pay $19.80 for two items. S. Lindqvist is exactly 60, and B5>=60 is TRUE, so their three items are free; write B5>60 and the pharmacy would charge a patient the rule says is exempt. The certificate is the only reason that has nothing to do with age, which is why A. Kowalski at 34 pays nothing while L. Nguyen at 28 pays for both items. Multiplying by D2 matters as much as the test: the charge is per item, not per prescription, so a flat $9.90 would undercharge every multi-item prescription. And because the rate lives in G2 rather than inside the formula, when the charge goes up next April one cell changes and every row follows, which is what the $ signs are for.