How to Extract Text With Excel's LEFT/LEFTB Function

Use only the part of the text data you need

High Angle View Of News Text Arranged With Alphabet Blocks On Wooden Table
Michael Zwahlen / EyeEm / Getty Images

When text is copied or imported into Excel, unwanted garbage characters are sometimes included with the good data. Sometimes, only part of the text data in the cell is needed — such as a person's first name, but not their last name.

For instances like these, Excel has functions that can be used to remove the unwanted data from the rest. The function you use depends on where the good data is located relative to the unwanted characters in the cell.

  • If the good data is on the right side, use the RIGHT function to extract it.
  • If the good data has unwanted characters on both sides of it, use the MID function to extract it.
  • If the good data is on the left side, use the LEFT function to extract it — this is the function we will showcase in this article.

Excel LEFT and LEFTB Function Syntax

Screenshot of Excel showing LEFT formulas

The LEFT and LEFTB functions are two options that performs similar operations but differ in the languages that they support. Follow the guidelines below and pick the function that best supports your language.

  • LEFT is for languages that use the single-byte character set; this group includes most languages such as English and all European languages.
  • LEFTB is for languages that use the double-byte character set; this includes Japanese, Chinese (Simplified), Chinese (Traditional), and Korean.

In Excel, a function's syntax refers to the layout of the function and includes the function's name, brackets, and arguments. The syntax for the LEFT function is: 

= LEFT ( Text , Num_chars )

The syntax for the LEFTB function is:

= LEFT ( Text , Num_bytes )

The function's arguments tell Excel which data it is to use in the functions and the length of the string to be extracted.

  • Text (required for LEFT and LEFTB) refers to the entry that contains the desired data. This argument can be a cell reference to the location of the data in the worksheet, or it can be the actual text enclosed in quotation marks.
  • Num_chars (optional for LEFT) specifies the number of characters on the left of the string argument to be retained. All other characters are removed.
  • Num_bytes - (optional for LEFTB) specifies the number of characters on the left of the string argument to be retained in bytes. All other characters are removed.

Important Notes About LEFT Function

  • If Num_chars/Num_bytes is omitted, the default value of 1 character is displayed by the function.
  • If Num_chars/Num_bytes is greater than the length of the text, the function returns the entire text string.
  • If the value of the Num_chars/Num_bytes argument is negative, the function returns the #VALUE! error value.
  • If the value of the Num_chars/Num_bytes argument references a blank cell or is equal to zero, the function returns a blank cell.

Excel LEFT Function Example

Screenshot of Excel showing the Formula dropdown for LEFT

There are several ways to use the LEFT function to extract a specific number of characters from a text string, including entering the data directly as arguments for the function and entering cell references for both arguments.

It is usually best to enter cell references for arguments rather than the actual data, so this example lists the steps used to enter the LEFT function and its arguments into cell C3 to extract the word Widgets from the text string in cell A3.

Entering the LEFT Function

Options for entering the function and its arguments into cell B1 include:

  • Typing the complete function into the appropriate cell.
  • Using Excel's Formula Builder.

Using the Formula Builder to enter the function often simplifies the task as it takes care of the function's syntax — entering the function's name, the commas separators, and brackets in the correct locations and quantity.

Pointing at Cell References

No matter which option you choose for entering the function into a worksheet cell, it is best to use point and click to enter the cell references used as arguments to minimize the chance of errors caused by typing in the wrong cell reference.

Entering LEFT with Formula Builder

Screenshot of Excel showing the Formula Builder

Enter the LEFT function and its arguments into cell B3 of the example image using the Excel Formula Builder.

  1. Click on cell B3 to make it the active cell — this is where the results of the function will be displayed.
  2. Click on the Formulas tab of the ribbon menu.
  3. Choose Text from the ribbon to open the function drop-down list.
  4. Click on LEFT in the list.
  5. In the dialog box, click on the Text line.
  6. Click on cell A3 in the worksheet to enter that cell reference into the dialog box.
  7. Click on the Num_chars line.
  8. Click on cell B10 in the worksheet to enter that cell reference.
  9. Click Done to complete the function.

The extracted substring Widgets should appear in cell B3.

Extracting Numbers With the LEFT Function

Screenshot of Excel showing the VALUE function

The LEFT function can be used to extract a subset of numeric data from a longer number using the steps listed in the previous section. The only problem is that the extracted data is converted to text and cannot be used in calculations involving certain functions, such as the SUM and AVERAGE functions.

One way around this problem is to use the VALUE function to convert the text into a number as shown in row 9 of the example image:

= VALUE ( LEFT ( B2, 6 ))

A second option is to use paste special to convert the text to numbers.