FormulaCamp
Completed
← All functions
Text

LEFT

First n characters.

Syntax

LEFT(text, [num_chars])

Example: =LEFT(A2,2)

Available in: All versions

LEFT returns a number of characters from the start of a text string: =LEFT(text, num_chars). Together with RIGHT (from the end) and MID (from any position) it splits codes, IDs and names into parts.

When to use it

Arguments explained

Worked examples

First three characters

A
1Code
2NYC-1042

Formula: C1: =LEFT(A2,3)

Result: NYC

Takes the first three characters of the code.

Middle of the string with MID

A
1Code
2NYC-1042

Formula: C1: =MID(A2,5,4)

Result: 1042

Starts at character 5 and takes 4 characters.

Everything before the @

A
1Email
2sam@example.com

Formula: C1: =LEFT(A2,FIND("@",A2)-1)

Result: sam

FIND returns the position of @ (4); subtracting 1 leaves the characters before it.

Try it

A tiny spreadsheet with example data. Edit the formula or any number and see the result.

Formula in D2: =LEFT(A2,5)

Example spreadsheet for LEFT
ABCD
1TextOtherResult
2Alice Johnsonalice johnsonAlice
3alice@shop.comALICE@shop.com
4 extra spaces
5SKU-2026-0415
6iced coffee, tea, sugar
7Order 417 shipped
Result in D2: Alice
Practice this in a lesson: Splitting Strings

Common errors and how to fix them

Related functions

Frequently asked questions

How do I get the last N characters?
Use RIGHT(text, N).
How do I get the middle of a string?
Use MID(text, start, length).
What if num_chars is larger than the text?
LEFT returns the whole string without an error.
How do I split text at a delimiter?
In Microsoft 365 use TEXTBEFORE, TEXTAFTER or TEXTSPLIT; elsewhere combine LEFT, MID and FIND.

More in Text