Microsoft Excel LEFT Formula: How to Extract Text from Cells

Formulas & functions · Updated November 20, 2026

Microsoft Excel’s LEFT function returns a chosen number of characters from the beginning of text. With the source text in A2 and the number of characters to return in B2, enter =LEFT(A2,B2) in C2; to return a fixed three-character prefix from A2, use =LEFT(A2,3).

What the LEFT Function Does

LEFT is a text function for taking characters from the left-hand, or starting, end of a text value. It is useful when entries follow a consistent pattern and you need to separate a prefix, code, initial, or other leading portion into its own cell. It does not alter the original value: it returns the extracted characters as a result in the cell containing the formula.

The function has two arguments: the text to examine and the number of characters to return. The second argument is optional. If you leave it out, Excel returns one character. If you specify zero, the result is empty text. If you ask for more characters than the text contains, Excel returns the whole text rather than an error.

For example, with the text ABC-104 in A2, a request for three characters returns ABC. The result is text, even if the characters look like a number. That distinction matters if you plan to use the result in calculations or preserve leading zeros.

Enter a LEFT Formula in Excel

In Microsoft 365 for Windows, select the cell where you want the result, type an equals sign and the function, and refer to the source cell. Press Enter to calculate it. In this example, A2 contains the text NORTH-27, and B2 contains the number 5; enter the following in C2. The result is NORTH.

With NORTH-27 in A2 and 5 in B2, enter =LEFT(A2,B2) in C2.

If the number of characters is fixed, enter it directly in the formula instead of referring to a second cell. With NORTH-27 in A2, enter =LEFT(A2,5) in C2; it returns NORTH. A cell reference makes it easier to adjust the number later, while a fixed number is convenient for a stable format.

To use the formula for more rows, select C2 and drag the small square at the lower-right corner of the cell down the column, or copy and paste the formula into the destination range. Excel adjusts relative references as it fills: the formula in C3 will refer to A3 and B3. On Windows, Ctrl+C and Ctrl+V copy and paste; on Mac, use Command+C and Command+V. If you enter a formula through Excel for the web, the basic function works the same way, although the ribbon and editing interface may differ slightly.

Useful Examples for Codes and Text

LEFT is especially handy when a column contains structured values. Suppose a report lists product codes with a three-letter category at the front. With the code ELE-4821 in A2, enter =LEFT(A2,3) in B2; B2 returns ELE. The same pattern can be filled down for other codes, provided the category is always three characters long.

It can also extract a fixed prefix from a longer identifier. With INV-2026-0048 in A2, enter =LEFT(A2,3) in B2; the result is INV. This is a character count, not a rule about separators. If the prefix length varies, a fixed count may cut off part of one value or include part of the next section. In that case, use the delimiter itself to determine where the prefix ends.

For example, with INV-2026-0048 in A2, enter =LEFT(A2,FIND("-",A2)-1) in B2. FIND locates the hyphen, and subtracting one tells LEFT to stop just before it. The result is INV. This is more flexible than a fixed count when the text before the hyphen can vary in length.

That delimiter formula assumes every source value contains a hyphen. If a value has no hyphen, FIND returns an error and the formula cannot determine the prefix. With possible missing hyphens, A2 containing the source text, enter =IFERROR(LEFT(A2,FIND("-",A2)-1),A2) in B2. If the hyphen is present, the result is the text before it; if it is absent, IFERROR returns the original value in A2. Use this approach only when returning the whole value is an appropriate fallback, since IFERROR can also hide other errors.

Numbers, Dates, and Leading Zeros

Although LEFT works on text, Excel can convert numbers to text when evaluating a text function. With the number 58391 in A2, enter =LEFT(A2,2) in B2; the result is the text 58. Because the output is text, it may not behave like the number 58 in a later calculation until you convert it appropriately.

Be careful with identifiers such as postal codes, account numbers, or product IDs. If 00427 is stored as a number, Excel does not retain the leading zeros as part of the underlying value. A cell format may make the value appear as 00427 on the worksheet, but a text formula may work from the stored number, 427. For reliable extraction, store identifiers as text when importing or entering them, or convert them to text using a method that explicitly includes the needed zeros.

Dates are another common source of confusion. Excel stores dates as serial numbers and displays them according to cell formatting. LEFT does not simply take the first characters that you see on screen in a date-formatted cell; it works with the value Excel supplies to the function. If you need characters from a particular date display, first convert the date to text with an intentional format, then extract from that text. Choose a format that matches the output you actually want, and consider regional settings because month names and date conventions can differ.

Common Problems and How to Fix Them

  • The result is too short or too long: Check the character count, including spaces and punctuation. LEFT counts every character in the requested position; it does not know which part of a value is a code or word.
  • You see #VALUE!: The number-of-characters argument may be negative or may contain an invalid value. Use zero or a positive number. A blank or nonnumeric entry in the count cell can also make the formula behave differently than expected.
  • Leading spaces appear in the result: Spaces count as characters. If unwanted spaces occur at the beginning of the source, clean the source data or use a text-cleaning function as part of a deliberate formula.
  • The formula displays as text instead of calculating: Check whether the cell is formatted as Text, or whether an apostrophe was entered before the equals sign. Change the cell to General, then re-enter the formula.
  • Excel rejects commas: Some regional settings use a semicolon as the argument separator. If Excel expects semicolons, use the separator indicated by your installation. Function names and date conventions can also vary by language or locale.

A useful troubleshooting habit is to inspect the source cell and the count argument separately. A formula may be syntactically correct but still return an unexpected result because the source contains hidden spaces, a value is stored as a number, or the assumed prefix length is inconsistent across rows.

LEFT Compared with Other Text Functions

Choose a function based on which part of the text you need. LEFT takes characters from the start. RIGHT takes characters from the end. MID extracts characters beginning at a position you specify. For instance, LEFT suits a leading department code, while RIGHT is more appropriate for a fixed-length suffix such as the last four characters of a reference number.

When you want text before a separator rather than a fixed number of characters, TEXTBEFORE can express that intention directly in Microsoft 365 and Excel 2024. With Mira Chen in A2, enter =TEXTBEFORE(A2," ") in B2; it returns Mira, the text before the first space. If you need a formula compatible with older Excel releases, LEFT combined with FIND is a common alternative, as shown above. TEXTBEFORE requires the separator to be present unless you provide suitable optional handling.

LEFT is not case-sensitive in the sense of making a distinction between uppercase and lowercase: it simply returns the characters that occupy the specified positions, preserving their original capitalization. It also extracts characters, not whole words. If the desired output is the first word, a delimiter-based method is usually more reliable than guessing how many characters that word contains.

Compatibility and Practical Tips

LEFT is a long-established Excel function and is available in Microsoft 365 for Windows, Excel for Mac, and Excel for the web. The basic formula syntax and results are consistent across these versions. In Mac Excel, formulas can be entered and filled using the same general approach; the main everyday keyboard difference is that Command is used for common copy and paste shortcuts instead of Ctrl.

Use LEFTB only when byte-based counting is specifically required for certain double-byte character-set languages. For ordinary text extraction, LEFT is the appropriate function: it counts characters rather than bytes. Most readers working with English-language names, labels, and identifiers do not need LEFTB.

Before applying a formula to an entire data set, test it against short, long, and irregular examples. Confirm that the prefix length is consistent, decide what should happen when a delimiter is missing, and check whether values that look numeric are actually stored as text. These checks prevent a formula that works for one sample from silently producing misleading results in other rows.

Frequently Asked Questions

What is the LEFT formula in Excel?
LEFT returns a specified number of characters from the beginning of text. For example, with ABC-104 in A2, =LEFT(A2,3) returns ABC.

What happens if I omit the number of characters?
Excel returns one character from the start of the text. If you want more, include a positive character count as the second argument.

Can LEFT return the first word in a cell?
Not reliably by itself, because words can have different lengths. In Microsoft 365 or Excel 2024, TEXTBEFORE can return text before a space; in older versions, combine LEFT and FIND when the space is present.

Why does LEFT remove the zeros from an ID?
The source may be stored as a number, so Excel has already discarded leading zeros from the underlying value. Store IDs as text or convert them using a method that preserves the required digits before extracting a prefix.

Does LEFT count spaces and punctuation?
Yes. It counts characters by position, including spaces, hyphens, and other punctuation. If the number of characters before a separator can vary, use a delimiter-based approach instead of a fixed count.

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.