What You Will Learn
Five customers. Each has an age. You need to label them as Minor (under 18), Adult (18–64), or Senior (65+).
| Rule | Label |
| Age under 18 | Minor |
| Age 18 to 64 | Adult |
| Age 65 or older | Senior |
The formula checks the thresholds in order — youngest group first. IFS is the cleanest way to write this:
=IFS(B2<18,"Minor",B2<65,"Adult",TRUE(),"Senior")
IFS checks each condition from left to right and returns the label for the first one that is true. If the age is 12, the first condition (B2<18) matches, so it returns "Minor" and stops — it never reaches the Adult or Senior checks. TRUE() at the end is the catch-all: if nothing else matched, the age must be 65+.
The order matters. If you checked for Senior before Adult, a 68-year-old would match "Adult" if the threshold was wrong — or worse, a 25-year-old could be labeled Senior if the logic is reversed.
Three age thresholds. Each age lands in exactly one bracket.
The audit formulas:
- B9:
=COUNTIF(C2:C6,"Minor") — counts the minors.
- B10:
=COUNTIF(C2:C6,"Senior") — counts the seniors.
In this dataset: Alice (12) and Diana (17) are Minors. Bob (25) and Ethan (45) are Adults. Charlie (68) is the only Senior.
Alternative: Nested IF
If your Excel version does not support IFS, nested IF gives the same result:
=IF(B2<18,"Minor",IF(B2<65,"Adult","Senior"))
The logic is the same — the outer IF checks for Minor, and the inner IF handles Adult vs Senior. The nesting gets harder to read with more categories, which is why IFS is preferred for multi-threshold rules.
Going Further: Reference Table
If the age brackets need to change often, store the thresholds in a small table and use XLOOKUP:
=XLOOKUP(B2,$F$2:$F$4,$G$2:$G$4,"Unknown",-1)
The -1 search mode finds the closest match going down, so an age of 25 would match the 18 row and return "Adult". This approach keeps the rules outside the formula, making them easier to update.
Watch the cutoff boundary. Age 18 lands in Adult, not Minor. Age 65 lands in Senior, not Adult. If the boundary is off by one, a person near the threshold gets the wrong label.
Use IFS in C2:C6 to sort ages into Minor, Adult, or Senior. Then use COUNTIF in B9 for minors and B10 for seniors.