Spreadsheet Practice

LEFT function

LEFT returns a set number of characters from the start of a text string. Use it to pull fixed-length codes off the front of IDs, SKUs and account numbers, such as the state prefix in NY-2026-0142.

Available in
Every current version
Category
Text functions
Returns
Text: the first num_chars characters, or the whole string if it is shorter than that.
Google Sheets
Works the same in Google Sheets.

Syntax

=LEFT(text, [num_chars])

ArgumentRequired?What it is
textRequiredThe text or cell to read from. Numbers work too and come back as text.
num_charsOptionalHow many characters to return. Leave it out to get just the first character.

Examples

Each result below is calculated from the sample sheet by our formula engine, the same one that grades the practice.

CellFormulaResultWhat it shows
D2=LEFT(A2,2)NYThe state code: the first two characters
D3=LEFT(B3)RNo num_chars, so just the first letter, handy for initials
D4=LEFT(A4,FIND("-",A4)-1)TXEverything before the first dash, whatever its length

Try it live

This is the sample sheet. Change any number or text, or edit a formula, and the results update.

Show the sample data as a table
Order IDCustomerResult
NY-2026-0142Ana LimaNY
CA-2026-0187Raj PatelR
TX-2025-0033Lee WongTX

Practice LEFT

From lesson 13, LEFT, RIGHT, MID & LEN. Graded instantly, then re-checked on changed data.

City code

In B2, extract the two-letter city code from the order code. Fill down to B6.

Common mistakes

What you seeWhy, and how to fix it
A number comes back as textLEFT always returns text, so =LEFT(2026,2) gives "20", which SUM ignores. Wrap it in VALUE or add 0: =VALUE(LEFT(A2,4)).
Dates return the wrong digitsA date is stored as a serial number such as 46088, and LEFT reads that number, not what you see. Use YEAR or TEXT(A2,"yyyy") instead.
Prefixes of different lengths get cut shortA fixed num_chars can't handle variable-length pieces. Find the delimiter with FIND, or use TEXTBEFORE in Excel 2024 and Microsoft 365.

Tips

  • Cut at a character by pairing LEFT with FIND: =LEFT(A2,FIND(" ",A2)-1) returns the first word.
  • If num_chars is longer than the text, LEFT returns the whole text without an error.

Questions

How do I extract the first word in Excel?

Use =LEFT(A2,FIND(" ",A2)-1). FIND gives the position of the first space, and you take one fewer character. In Excel 2024 or Microsoft 365, =TEXTBEFORE(A2," ") does the same.

How do I remove the first few characters instead of keeping them?

Keep the rest with RIGHT: =RIGHT(A2,LEN(A2)-3) drops the first three characters. =REPLACE(A2,1,3,"") works too.

Lessons that use LEFT

Last reviewed October 2026. Every example result on this page is calculated live by the Spreadsheet Practice formula engine.