Home
Challenges
Map Product Categories
Lookup
Easy

Map Product Categories

An Excel product list uses short code prefixes, and you need to convert them into readable category names.

AuthorExcelClash Team
PublishedApr 02, 2026
Map Product Categories

The Problem

Short product codes are useful for systems, but they are not always useful for people reading a report. A prefix like EL may make sense to the warehouse team, yet the wider business usually wants to see a full category name.

This challenge is about translating those short prefixes into readable labels. Once the category names are filled in, the sheet becomes easier to scan and the summary at the bottom becomes much clearer.

How We Solve It

The first step is to extract the first two characters from the product code. That prefix is the part that identifies the category, so we can map it to a full label with either a direct formula rule or a lookup table.

Method 1: SWITCH for a direct mapping

Basic Switch Illustration
Method 1: Map the prefix directly inside the formula with SWITCH.

This is the method used in the solution. LEFT extracts the two-letter prefix, and SWITCH turns that prefix into a full category name. It works well when the code list is short and stable.

This solves the challenge directly because each product code already carries the category hint in its first two characters. Once that prefix is pulled out, SWITCH can translate it into the readable label the worksheet needs in column B.

=SWITCH(LEFT(A2,2),"EL","Electronics","HG","Home & Garden","AP","Appliances")

Method 2: Use a lookup table

VLOOKUP Mapping Illustration
Method 2: Use a lookup table when the code list may grow later.

If the company adds more prefixes over time, a mapping table is easier to maintain than a long formula. The prefix is still extracted first, but the lookup table keeps the mapping rules out of the main cell formula.

This solves the same mapping problem in a more scalable way. Instead of editing the formula every time a new code appears, the team can update the mapping table and let the lookup return the right category from there.

=VLOOKUP(LEFT(A2, 2), $F$2:$G$4, 2, FALSE)

Method 3: XLOOKUP for a modern version

XLOOKUP Prefix Illustration
Method 3: Use XLOOKUP for a more flexible modern mapping pattern.

XLOOKUP does the same kind of mapping with a cleaner structure and a built-in fallback value. It is a good choice when you want more flexibility or expect the lookup setup to change later.

This solves the category problem with a more modern lookup pattern. It still starts from the extracted prefix, but it adds a fallback result and keeps the mapping logic easier to expand if the product code list changes later.

=XLOOKUP(LEFT(A2, 2), $F$2:$F$4, $G$2:$G$4, "Other")

Function Explanation

1. LEFT

LEFT returns a chosen number of characters from the start of a text string. In this challenge, it isolates the category prefix from each product code.

Learn more this functionLEFT

2. SWITCH

SWITCH compares one value against a series of options and returns the matching result. It keeps a short mapping formula readable when the list of codes is small.

Learn more this functionSWITCH

3. XLOOKUP

XLOOKUP searches for one value and returns a result from another range. It is useful when the mapping needs to live in its own table instead of inside the formula.

Learn more this functionXLOOKUP

The important part is making sure the extracted prefix matches the structure of the product codes. If the code format changes, the first step to revisit is usually the LEFT part.

Try Yourself

Translate each product-code prefix into its full category name, then finish the summary so the sheet shows the total number of records and how many items belong to the Electronics category.

1
Objective #1
Cell: B2-B6

In Column B, assign a Full Category Name based on the prefix in Column A (EL = Electronics, HG = Home & Garden, AP = Appliances).

2
Objective #2
Cell: B9

In cell B9, count the total number of items in your inventory list.

3
Objective #3
Cell: B10

In cell B10, identify the total count of items in the "Electronics" category.

Tactical Arena
Objectives Met: 0 / 0
Share this challenge
Share this challenge

Let others know about this challenge!

Related Challenges
Forecasting
#23
Estimate Completion Time

An Excel task sheet has start dates and durations, and you need to calculate delivery dates without counting weekends.

Easy
Cleanup
#24
Validate Email Formats

An Excel email list contains questionable entries, and you need to flag which ones match a basic valid format.

Easy
Cleanup
#25
Extract First Word from Text

An Excel text list contains multi-word entries, and you need to pull the first word so the data is easier to group.

Easy
Cleanup
#26
Merge Multiple Columns into One

An Excel address sheet stores details in separate columns, and you need to combine them into one clean mailing line.

Easy
Discussion
0 Feedbacks
ExcelClash

ExcelClash is an interactive platform designed to level up your Excel skills through real-world exercises and challenges. Sharpen your logic, solve real spreadsheet problems, and learn faster—without boring lessons. Just hands-on practice that actually sticks.

Navigation
Back to Challenges
Go to Dashboard
Platform Home
Discover
SUM FunctionsLookup FunctionsConditional FunctionsLogical Functions
Support
About UsContact UsPrivacy PolicyTerms of Service
© 2026 ExcelClash, Inc. All rights reserved.
Objectives Met: 0 / 0