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.
- How to use Vlookup function in Excel
- How to combine Sumif and Vlookup functions in Excel
- Use VLOOKUP to join two Excel tables together
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:
- 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.
- 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.
- Num_chars must be greater than or equal to zero, if num_chars
- Num_chars is larger than the length of the text, the LEFT function returns the entire text.
- 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 result is that we get 3 characters from left to right of the character string in cell B2.
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.
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 result you get is the character string in the box. Scroll down to the boxes below to get more results.
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 result will only get the country code in the phone number.
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.
As a result, we have the remaining characters when we have removed the last 5 characters in the character string, including spaces.
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 result is the number to look for as shown.
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!
You should read it
- LEFT function in Excel, how to use LEFT function and illustrative examples
- How to combine Vlookup function with Left function
- How to use the FIND function in Excel?
- How to use MID functions to get strings in Excel
- How to use Excel's VALUE function
- Do you know the structure and usage of the LEFT function in Excel?
- The function takes a string in Excel
- How to use the Search function in Excel
- LEFT function in SQL Server
- How to use Hlookup function on Excel
- Instructions on how to count words in cells in Excel
- How to use the LEN function in Excel
Maybe you are interested
The 'Windows 11 style' Microsoft Edge interface is available, activate and experience immediately Google Chrome can be tweaked to match the style of Windows 11 What designers can learn from the amazing UX design of the Candy Crush game Microsoft has revealed the new Windows 10 interface, inviting you to view and comment Firefox 5 - Chrome 'Imitator'? How to politely introduce yourself and others