The LEFT function, how to use the left-hand string cutting function in Excel

The LEFT function in Excel is used to trim the left string of characters in data parameters.

One of the basic Excel functions that users often work with Excel needs to know that is the LEFT function. The LEFT function is a group of string handling functions, used to cut the string of characters to the left of the text string. The LEFT function is often used to find information quickly, rather than manually searching for information or strings. Special LEFT function can be combined with other lookup functions in Excel to handle complex information tables such as combining LEFT function with Vlookup function. The following article will show you how to use LEFT function in Excel.

  1. How to use Vlookup function in Excel
  2. How to combine Sumif and Vlookup functions in Excel
  3. Use VLOOKUP to join two Excel tables together

  4. The COUNTA function, how to use the function to count cells containing data in Excel

Instructions for using LEFT function in Excel

The LEFT function has a syntax of = LEFT (text; [num_chars]) . Inside:

  1. Text is the required text string, this is the text string or cell reference to the text string containing the characters you want to extract.
  2. Num_chars is an optional argument, this is the number of characters you want the LEFT search function to start from the first position to the left of the text.
  3. Num_chars must be greater than or equal to zero, if num_chars
  4. Num_chars is larger than the length of the text, the LEFT function returns the entire text.
  5. If num_chars is omitted, the default num_chars = 1.

Example 1: Use the LEFT function to find the character

In the table below, use LEFT function to find the first 3 characters in cell B2. Enter the formula = LEFT (B2.3) and press Enter.

The LEFT function, how to use the left-hand string cutting function in Excel Picture 1The LEFT function, how to use the left-hand string cutting function in Excel Picture 1

The result is that we get 3 characters from left to right of the character string in cell B2.

The LEFT function, how to use the left-hand string cutting function in Excel Picture 2The LEFT function, how to use the left-hand string cutting function in Excel Picture 2

Or in the input formula, you can replace the position of the cell containing the string with the character and enclosed in the quotation mark as shown.

The LEFT function, how to use the left-hand string cutting function in Excel Picture 3The LEFT function, how to use the left-hand string cutting function in Excel Picture 3

Example 2: The LEFT function combines SEARCH function

When combining these two functions together, we will use it to search for a string of characters preceded by a certain character, such as taking the last name in the full name column, taking the country code except the phone number. In the column name are separated by spaces, so we use the formula = = LEFT (B2, SEARCH ("", B2) -1) and then press Enter.

Then -1 to not extract space characters when searching for characters.

The LEFT function, how to use the left-hand string cutting function in Excel Picture 4The LEFT function, how to use the left-hand string cutting function in Excel Picture 4

The result you get is the character string in the box. Scroll down to the boxes below to get more results.

The LEFT function, how to use the left-hand string cutting function in Excel Picture 5The LEFT function, how to use the left-hand string cutting function in Excel Picture 5

For the phone number range that you want to get the country code before the dot, enter the formula = LEFT (B5, SEARCH (".", B5) -1) and press Enter.

The LEFT function, how to use the left-hand string cutting function in Excel Picture 6The LEFT function, how to use the left-hand string cutting function in Excel Picture 6

The result will only get the country code in the phone number.

The LEFT function, how to use the left-hand string cutting function in Excel Picture 7The LEFT function, how to use the left-hand string cutting function in Excel Picture 7

Example 3: Combining LEFT function with LEN function

LEN functions are very useful in combination with the string finder functions. With LEFT function when adding LEN function to remove certain characters from the end of the string. Combination formula = LEFT (text, LEN (text) - character to move).

The LEN function takes the total number of characters in a string, then subtracts the number of characters to remove from the total length of the sequence. The LEFT function will return the remaining number of characters.

For example, remove the 5 characters of the string in cell B2, enter the formula = LEFT (B2, LEN (B2) -5) and press Enter.

The LEFT function, how to use the left-hand string cutting function in Excel Picture 8The LEFT function, how to use the left-hand string cutting function in Excel Picture 8

As a result, we have the remaining characters when we have removed the last 5 characters in the character string, including spaces.

The LEFT function, how to use the left-hand string cutting function in Excel Picture 9The LEFT function, how to use the left-hand string cutting function in Excel Picture 9

Example 4: Combining LEFT function and VALUE function

When these two functions work together, it returns the numeric character, instead of the text string as in the LEFT function. For example, export the first 2 characters of the string in cell B5, enter the formula = VALUE (LEFT (B2.2)).

The LEFT function, how to use the left-hand string cutting function in Excel Picture 10The LEFT function, how to use the left-hand string cutting function in Excel Picture 10

The result is the number to look for as shown.

The LEFT function, how to use the left-hand string cutting function in Excel Picture 11The LEFT function, how to use the left-hand string cutting function in Excel Picture 11

Above is how to use the LEFT function to get the character string from the left and examples when combining LEFT function with other functions. If an error occurs, the user needs to check if num_chars is greater than 0.

I wish you all success!

5 ★ | 2 Vote