LEFT Excel String Formula: Extract Text from the Left

Formulas & functions · Updated November 18, 2026

In Excel, use the LEFT function to return a chosen number of characters from the beginning of a text value. If A2 contains “Northwind” and you want its first five characters, enter =LEFT(A2,5) in another cell; the result is “North”.

What the LEFT function does

LEFT is a text function: it starts at the first character on the left and returns characters in order until it reaches the requested count or the end of the value. It does not search for a particular letter or word, and it does not remove or change the original cell contents. The result is a separate text value, so the source remains intact.

The function is useful when information follows a consistent pattern, such as a department code at the start of an employee ID, a country prefix at the start of a code, or a fixed number of characters that identifies a product category. It can also be combined with other Excel functions when the number of characters to return varies.

For Microsoft Excel for Microsoft 365 on Windows, the function name is LEFT. It is also available in Excel for Mac and Excel for the web. The function works the same way across these versions; however, regional settings can affect formula separators. The examples here use commas, as is standard in many English-language installations.

LEFT syntax and arguments

The function takes a value to read and, optionally, the number of characters to return. The first argument is required; the second can be left out. Excel uses a default count of one character when you omit it.

  • Text: The text, cell reference, or other value from which characters are taken.
  • Num_chars: The number of characters to return, counting from the left. This must be zero or a positive number.

For the examples in this article, assume the text is in cell A2 unless a different layout is stated. With “Northwind” in A2, =LEFT(A2) returns “N”, because the character count is omitted and defaults to one. With the same value in A2, =LEFT(A2,0) returns an empty text string. Requesting more characters than the text contains returns the whole text rather than an error.

Enter a formula in a cell outside the source data, then press Enter. To use it for more rows, copy or fill the formula down; a relative reference such as A2 adjusts to A3, A4, and so on. If the source is in a formatted Excel table, a formula entered in a table column generally fills down for the other rows automatically.

Basic examples with cell references

Suppose A2 contains the product code “AB-4927”. To return the first two characters, use =LEFT(A2,2); the result is “AB”. This is a straightforward way to separate a prefix when the prefix always has the same length.

If A2 contains “INV-2026-0314”, the first four characters are “INV-”. With this layout, the formula =LEFT(A2,4) returns that prefix, including the hyphen. Punctuation and spaces count as characters, so check whether a delimiter belongs in the result before choosing the count.

You can also give the text directly rather than referencing a cell. For example, =LEFT("Spreadsheet",5) returns “Sprea”. In ordinary worksheets, a cell reference is usually more useful because the formula updates when the source value changes. Text written directly in a formula must be enclosed in straight double quotation marks.

For a column of IDs in A2:A100, place a formula in B2 and fill it down to extract the same number of starting characters from every ID. A fixed count is appropriate only when the codes follow a consistent structure. If some IDs have shorter prefixes or different separators, a delimiter-based approach is safer.

Extracting text up to a delimiter

A common task is returning everything before a space, hyphen, or other separator. The FIND function can locate a delimiter, and subtracting one gives the number of characters before it. If A2 contains “Maya Chen”, then =LEFT(A2,FIND(" ",A2)-1) returns “Maya”. The space is at position five, so subtracting one tells LEFT to return the first four characters.

FIND is case-sensitive, though that distinction usually does not matter for a space or punctuation mark. If the delimiter might be absent, the example formula returns an error because FIND cannot locate it. One way to handle that possibility is to return the entire cell value when the search fails. With a name or code in A2, =IFERROR(LEFT(A2,FIND(" ",A2)-1),A2) returns the text before the first space when one exists, and the full value when it does not.

For newer Excel versions, TEXTBEFORE is often easier to read when the goal is specifically to extract text before a delimiter. In Microsoft 365 or Excel 2024, if A2 contains “Maya Chen”, =TEXTBEFORE(A2," ") returns “Maya”. LEFT remains useful when you need a fixed character count or need to support a version without TEXTBEFORE.

Spaces, blank cells, and inconsistent text

LEFT counts spaces as characters. If A2 begins with two spaces followed by “Report”, =LEFT(A2,3) returns two spaces and the letter “R”. The result may look blank or shorter than expected because leading spaces can be difficult to see. To remove leading spaces before taking a fixed number of characters, use TRIM inside the formula. With “ Report” (two leading spaces) in A2, =LEFT(TRIM(A2),3) returns “Rep”.

TRIM removes leading and trailing ordinary spaces and reduces repeated spaces between words to a single space. That can be helpful for inconsistent data, but it may not remove every invisible character copied from a website or another system. Nonbreaking spaces, for example, may need to be replaced separately. If a result seems wrong despite looking correct, inspect the source for hidden characters rather than changing the character count at random.

A blank source cell normally produces an empty result when used with LEFT. A formula that returns an empty string is not always identical to a truly empty cell for every Excel operation, so consider that difference if another formula or a chart depends on whether cells are blank. Also note that LEFT preserves the case of the source text; it does not convert uppercase to lowercase or vice versa.

Using LEFT with numbers and dates

Although its purpose is text extraction, LEFT can accept a numeric value, which Excel converts to text for the function. This can be useful for consistently formatted codes stored as numbers, but it can be risky: numeric values do not preserve leading zeros. If a code is “00481” but Excel stores it as the number 481, the original zeros are already missing from the value. Format or import identifiers carefully as text when leading zeros matter.

Dates need extra care because Excel stores dates as serial numbers and displays them according to cell formatting. LEFT works with the underlying value converted to text, not necessarily the date string you see on the worksheet. To extract the year as displayed in a deliberate format, first use TEXT. With a real date value in A2, =LEFT(TEXT(A2,"yyyy-mm-dd"),4) returns the four-digit year; if A2 is January 15, 2026, the result is “2026”. The format code makes the intended date representation explicit.

For calculations and sorting, keeping dates as dates is usually more useful than turning part of one into text. If you need a year for analysis, a date function such as YEAR returns a number instead of a text fragment. Use LEFT when the task is genuinely string extraction, not merely because the date happens to look like text on screen.

Common errors and troubleshooting

The most common error is using a negative character count. If A2 contains “Northwind”, =LEFT(A2,-1) returns #VALUE! because the count cannot be negative. A count of zero is allowed and returns an empty string. A decimal count is treated as a whole-character count by Excel, so use an intentional integer to make formulas easier to understand.

If the result has one extra character, check whether the separator is included in the count. For example, “AB-4927” has a hyphen in position three, so taking three characters includes it; taking two does not. If the number of characters varies from row to row, use a search function to locate the delimiter rather than hard-coding one count.

If you see the formula itself in the cell instead of its result, check that the cell is not formatted as Text and that the formula begins with an equals sign. Change the cell format to General, then re-enter the formula. Also check whether Show Formulas is turned on; it changes the worksheet display from results to formulas. A formula may also show as text if an apostrophe was typed before the equals sign.

When to choose LEFT or another function

Choose LEFT when you want characters from the start of a value and know how many to take. Use RIGHT for characters at the end, and MID when extraction starts at a position inside the text. For example, if a fixed-format code has a prefix, a middle segment, and a final suffix, these functions address different parts of that string.

When the stopping point is a delimiter rather than a fixed position, TEXTBEFORE can make the intention clearer in supported Excel versions. For older versions, combining LEFT with FIND is a broadly useful alternative. If the objective is to clean text, standardize spaces, or split a full column into multiple fields, consider whether a dedicated text-cleaning or text-splitting method better matches the job. The best option depends on whether the rule is based on a character count, a separator, or data cleanup.

As a practical rule, test formulas on a few representative rows before filling them down: include the shortest value, a value with a missing delimiter, and one with unexpected spaces if those cases are possible. This helps reveal assumptions in the source data before they affect a full report.

Frequently Asked Questions

Does LEFT include spaces?
Yes. Spaces, hyphens, and other characters in the source count toward the requested number. If unwanted leading or repeated spaces are present, clean the text first or account for them in the formula.

What happens if I leave out num_chars?
Excel returns one character from the left when the optional character-count argument is omitted. For example, with “Northwind” in A2, =LEFT(A2) returns “N”.

Can LEFT return text before a space?
Yes. You can combine LEFT with FIND to calculate the number of characters before the first space. In Microsoft 365 or Excel 2024, TEXTBEFORE is another direct option.

Why does LEFT return the wrong part of a date?
Dates are stored as numbers, while their visible appearance comes from cell formatting. Use TEXT to set the date format you want before extracting characters, or use a date function if you need a numeric year or month.

Is LEFT case-sensitive?
LEFT does not search or compare text; it returns the characters as they appear, preserving their existing case. Case sensitivity matters more when choosing a search function to locate a delimiter or matching text.

Related

Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.

More in Formulas & functions

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.