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.

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

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

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

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.

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

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.

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

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

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

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.

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

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

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

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.

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

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

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

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)).

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

The result is the number to look for as shown.

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

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!

Update 25 May 2019
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile