Excel LEFT

LEFT returns a set number of characters from the beginning of a text value.

An inventory clerk has product codes where the first two letters are a country. Filtering by country needs that piece in its own column. LEFT extracts it, and retyping thousands of codes is never needed.

Practice it now

How to write it

=LEFT(text, [num_chars])
text
The text to read.
num_chars
How many characters. Defaults to 1.

Watch it work

D2fx 
ABCDE
1SKUQty
2NG-2041-B3
3KE-1180-A5
4ET-7732-C2
5ZA-5521-D1
6
1

Takes the first two characters.

Examples

The country code

=LEFT(A2,2)NG

Takes the first two characters.

Code without the size letter

=LEFT(A3,7)KE-1180

Takes the first seven.

Everything before the first dash

=LEFT(A4,FIND("-",A4)-1)ET

FIND works out the length, so it handles parts of any size.

Your turn

Extract the first seven characters from the SKU in A5. Type your formula in D2.

ABCD
1SKUQty
2NG-2041-B3
3KE-1180-A5
4ET-7732-C2
5ZA-5521-D1
6

Common mistakes

The result won't add up.

LEFT returns text. Wrap it in VALUE for numbers.

Fixed lengths on varying data.

Combine with FIND, or use TEXTBEFORE.

Good to know

  • LEFT is ideal when the structure is fixed.
  • Dates in real date cells are numbers, so use YEAR or TEXT on them instead.
  • LEFT or TEXTBEFORE? LEFT counts characters. TEXTBEFORE stops at a delimiter and needs no counting.