Lab › Data Cleaning › Split a Product Code

Split a Product Code: Excel Lab

Lab 26 · BeginnerLEFTMIDRIGHT

The task: Codes look like EL-1042-A: category, number, grade. Pull the three parts into their own columns.

1 Watch how it is done

  1. Step 1: Category = first 2 characters

    =LEFT(A4,2)

    • Click B4.
    • Type =LEFT(A4,2) and press Enter.
    • Drag the fill handle down.
  2. Step 2: Number = 4 characters from position 4

    =MID(A4,4,4)

    • Click C4.
    • Type =MID(A4,4,4) and press Enter. Start at 4, take 4.
    • Drag the fill handle down.
  3. Step 3: Grade = last character

    =RIGHT(A4,1)

    • Click D4.
    • Type =RIGHT(A4,1) and press Enter.
    • Drag the fill handle down.

2 Your turn

Download the practice file. It has new numbers. Open it in Excel (or Google Sheets) and do the same steps.

⬇ Download the practice file

3 Check your answers

Stuck? Download the solution file and compare it with yours.

Next lab: Split First and Last Name →
Want the theory? Read the Data Cleaning lessons →
← More Data Cleaning labs · All lab categories