LEFT / Teacher

Extract Year Level from Class Code

I have class codes like '10-MATH' and need to extract just the '10' to group students by grade level.

formula.xlsx
=LEFT(A2, 2)

How it works: The LEFT function extracts a specified number of characters from the beginning (left side) of a text string. In this formula, `A2` refers to the cell containing the class code '10-MATH', and `2` specifies that we want to extract the first two characters, which correspond to the year level '10'.

Data Setup

Class Code
10-MATH
09-ENG
11-SCI
12-HIST
08-ART

Step-by-Step Guide

1

Open your Excel worksheet containing the class codes.

2

Select the cell where you want the extracted year level to appear (e.g., B2, assuming your first class code is in A2).

3

Type the formula: `=LEFT(A2, 2)`

4

Press Enter to see the result for the first class code.

5

Drag the fill handle (the small square at the bottom-right of the selected cell) down to apply the formula to all other class codes in your list.

Explore More