The beginning of a code often tells you the category. ELC for electronics, MBL for furniture, CLI for client. By combining IF with a text function, you can classify a whole list automatically from these prefixes.
The following exercise shows you how to combine IF with text functions.
What you will practice in this exercise
You work on product and customer codes. You answer 6 questions, one formula per question:
- Is the family code “ELC”? (test on MID)
- “Electronics” or “Other” (IF)
- Three categories with nested IF
- “Client” or “Prospect” from the prefix (IF + LEFT)
- “Large furniture” if family MBL and price over 100 (IF + AND)
- The same test on another product
Practice with exercises
IF + prefix — Category
Classify products and customers by their prefix, combining IF and text functions.
Related articles
All the exercises in this series are based on real cases found on Excel forums. Each one answers a question that Excel users really ask.