The LEFT function, how to use the left-hand string cutting function in Excel
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
- 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
May be interested
- Do you know the structure and usage of the LEFT function in Excel?this article guides you in detail about the structure and usage of common and effective left function in excel
- The MID function in Excel, how to use the MID function, and examplesthe mid function in excel, how to use the mid function, and examples. the mid function in excel is a function of the text function group, you use the mid function if you want to cut the string in the middle of the text string when processing the string. if you do not know or do not understand the mid function, then you
- How to use the LEN function in Excelthe len function in excel is used to measure the length of a certain string of characters, including spaces and correctly return the total character for the user.
- CONCATENATE function (string concatenation function) in Exceluse the concatenate function when you want to concatenate existing text strings into a single, complete text string. for the syntax and usage of the concatenate function, follow the article below.
- RIGHT function, how to use the right-cut string function in Excelright function in excel is a function that takes characters from the right in a string.
- ENCODEURL function - The function returns a query string with URL code in Excelencodeurl function: the function returns a query string with the url code. support functions from excel 2013 onwards. syntax: encodeurl (text)
- String (String) in PHPstring is a sequence of characters, you will find available string handling functions in php at php string (string) handler
- Find, FindB functions in Excel - The function finds a text string in another document in Excelthe find and findb functions help you find a text string in another text and return the value as the location of the text string to be found in the search text. depending on the different default languages that you apply the find or findb function properly.
- How to use the Search function in Excelthe search function in excel is used to search for the position and order of a text string, so you can find the position of the word or the data you need.
- How to use the TEXTJOIN function in Excel 2016the textjoin function concatenates text from multiple ranges and / or strings, which includes a delimiter between the connected text value. if the delimiter is an empty text string, this function effectively matches the ranges.