Excel LEFT Function: Extract First Characters Fast

Learn how Excel's LEFT function extracts the first characters from text. Step-by-step examples, common errors, and practical tips for office workers and students.

LEFT function — SheetSkill guide
In short

The LEFT function returns the first characters from a text string, based on a number you specify. It is ideal for pulling codes, initials, or prefixes from longer text without manual editing.

=LEFT(text, [num_chars])

What does LEFT do?

The LEFT function in Excel extracts a specified number of characters from the beginning of a text string. You give it the text and how many characters you want, and it returns just that leading portion. For example, =LEFT("Excel", 2) returns "Ex". It is one of the simplest text functions, but it solves many everyday data problems.

Why does it matter? Office workers and students often deal with text that contains useful information at the start: product codes, area codes, initials, or date parts. Instead of retyping or using complex formulas, LEFT lets you isolate that prefix quickly and consistently. It also works well inside other formulas, such as combining it with IF or VALUE.

Imagine a list of employee IDs like "EMP-1023" and you need only the "EMP" prefix to group records. Or a column of full names where you want the first initial. LEFT handles these tasks in seconds. This guide walks through the syntax, worked examples, common mistakes, and tips so you can use LEFT confidently.

When to use LEFT

  • Extracting area codes or prefixes from phone numbers.
  • Getting the first initial from a full name.
  • Pulling a fixed-length product category code from a SKU.
  • Isolating the year from a text date like "2024-05-01".
  • Removing unwanted characters from the start of imported text.
  • Creating short labels from longer descriptions.

LEFT syntax

=LEFT(text, [num_chars])
ArgumentRequired?What to enter
textRequiredThe text string or cell reference from which to extract characters. Example: A2 or "Hello".
num_charsOptionalThe number of characters to extract from the left. If omitted, it defaults to 1. Must be zero or greater. Example: 3.

What it returns: A text string containing the specified number of characters from the start of the original text. If num_chars is greater than the text length, the entire text is returned. If num_chars is 0, an empty string is returned.

LEFT examples

1 Extract the first three characters of a product code

Column A contains product codes. The goal is to pull the first three characters, which represent the category. The formula =LEFT(A2, 3) looks at cell A2 and returns the first three characters. For "PRD-1001", it returns "PRD". Copy the formula down to apply it to other rows.

C2=LEFT(A2, 3)
ABCD
1ProductCode
2PRD-1001PRD
3PRD-1002
4SRV-2001
5SRV-2002
6ACC-3001
7ACC-3002
8
The formula in C2 returns PRD.

2 Get the first initial from a full name

Column A has full names. You want the first initial for a badge or short label. The formula =LEFT(A2, 1) returns just the first character of the name in A2. For "Alice Johnson", it returns "A". This works for any name length.

C2=LEFT(A2, 1)
ABCD
1FullName
2Alice JohnsonA
3Bob Smith
4Carol White
5David Brown
6Eva Green
7
The formula in C2 returns A.

3 Extract the area code from a phone number

Column A contains phone numbers stored as text. The area code is the first three digits. The formula =LEFT(A2, 3) returns those three characters. For "555-123-4567", it returns "555". This helps group or filter by region.

C2=LEFT(A2, 3)
ABCD
1Phone
2555-123-4567555
3212-987-6543
4415-555-0000
5305-444-1111
6
The formula in C2 returns 555.

4 Combine LEFT with IF to flag a prefix

Column A has order IDs. You want to flag orders that start with "UK" as international. The formula =IF(LEFT(A2,2)="UK","International","Domestic") checks the first two characters. If they are "UK", it returns "International"; otherwise "Domestic". For "UK-1001", it returns "International".

C2=IF(LEFT(A2,2)="UK","International","Domestic")
ABCD
1OrderID
2UK-1001International
3US-1002
4UK-1003
5CA-1004
6
The formula in C2 returns International.

Common LEFT errors and how to fix them

ErrorWhy it happensHow to fix it
#VALUE!num_chars is negative or non-numeric.Ensure num_chars is a number zero or greater. Use a positive integer or omit it.
#NAME?The function name is misspelled, e.g., "LEF" instead of "LEFT".Check the spelling: it must be LEFT.
Empty resultnum_chars is 0 or the text is empty.Set num_chars to at least 1, and verify the source cell contains text.
Unexpected charactersLeading spaces in the text are counted as characters.Use TRIM on the source text before applying LEFT, e.g., =LEFT(TRIM(A2),3).

Tips for using LEFT

  • If num_chars is omitted, LEFT returns the first character by default.
  • Use LEFT with VALUE to convert extracted numbers from text to numeric values.
  • Combine LEFT with FIND or SEARCH to extract text before a delimiter.
  • Remember that LEFT always returns text, even if the result looks like a number.
  • To extract characters from the end of a string, use the RIGHT function instead.
  • Test your formula on a few rows before filling it down to catch unexpected spaces or formats.

Frequently asked questions

What does the LEFT function do in Excel?

LEFT returns the first characters from a text string, based on the number you specify. It is useful for extracting prefixes, codes, or initials.

Can LEFT return a number instead of text?

LEFT always returns text. To get a number, wrap it with VALUE, for example =VALUE(LEFT(A2,3)).

How do I extract characters after a space using LEFT?

Use LEFT together with FIND to locate the space: =LEFT(A2, FIND(" ", A2)-1) returns everything before the first space.

What happens if num_chars is larger than the text length?

LEFT returns the entire text string without error.

Related functions

Every example on this page was recalculated by SheetSkill’s spreadsheet engine. LEFT reference