RIGHT function, how to use the right-cut string function in Excel
In order to search for information, data on Excel tables can use many other functions such as VLOOKUP function in Excel, Excel LEFT function, etc. And in this article, users will know how to use RIGHT function to find characters in a selected string.
If the LEFT function separates the left string, RIGHT is the opposite, separating the string from the right in a sequence of characters that the user selects. Then RIGHT returns the result of one or more last characters in a text string based on the number of characters displayed in the data field. The following article will guide you how to use RIGHT function in Excel.
- How to combine Sumif and Vlookup functions in Excel
- Use VLOOKUP to join two Excel tables together
- How to use MID functions to get strings in Excel
- Instructions on how to fix reverse dates in Excel
Instructions for using RIGHT function in Excel
The RIGHT function has a syntax of = RIGHT (text, [num_chars]) . Inside:
- text: is the text string you want to extract characters.
- num_chars: the number of characters you want RIGHT to extract.
Note:
- If num_chars omits, its default is 1.
- Num_chars must always be greater than or equal to 0.
- If num_chars is larger than the length of the text string, RIGHT returns the entire text string.
Example 1: Use the RIGHT function to find the character
For example, with the data table below, proceed to extract the last 3 characters in each data cell. In the result box enter the formula = RIGHT (B2,3) and press Enter.
The result is the last 3 characters in the character sequence as shown below. Scroll down the remaining boxes to show other results.
In addition, we can also enter a sequence of characters as shown below, but use quotation marks.
Example 2: The RIGHT function looks for the numeric character
These two functions combined together will return a numeric value. Because the RIGHT function in Excel always returns text strings, even if the original value is a number. If adding VALUE function, the result is number. You refer to the example combining two functions in the article How to use Excel's VALUE function.
Example 3: The RIGHT function exports the character after a specific character
When you want to separate the string of characters following a specific character, use the SEARCH function in Excel or the FIND function to determine the character position, but subtract the selected character position in the total string of characters returned by the function. WOOL. The combined formula is = RIGHT (text string, LEN (text string) - SEARCH (character, text string)) .
With this example, you need to find the name in the Name box, enter the formula = RIGHT (B2, LEN (B2) -SEARCH ("", B2)) and press Enter.
The result is our name as shown below. Scroll down to display the remaining results.
By combining these three functions, we can apply it to output the string of characters after any other character, such as commas, two dots, hyphens, .
Example 4: The RIGHT function of the first n characters in the string
Formula using RIGHT (string, LEN (string) -number of chars to remove) .
In this data table will remove the first 6 characters including the dot from the string. Enter the formula = RIGHT (B2, LEN (B2) -6) and press Enter. The result we get is as shown below.
Example 5: The RIGHT function outputs the character after the last delimiter
With complex strings of multiple delimiters, the content extraction must be separated from the final delimiter. With the data table below, there is a cell that uses only 1 delimiter, but has cells that use 2 delimiters and requires the character after the final delimiter.
Apply the formula to this data table we enter = RIGHT (B6, LEN (B6) -SEARCH ("$", SUBSTITUTE (B6, ":", "$", LEN (B6) -LEN (SUBSTITUTE (B6 , ":", ""))))) and press Enter. Inside:
- LEN (B6): the total length of the string in cell B6.
- LEN (SUBSTITUTE (B6, ":", "")): length of character string without a colon.
- LEN (B6) -LEN (SUBSTITUTE (B6, ":", "")): The total initial length minus the string length without a colon.
- SUBSTITUTE (B6, ":", "$", LEN (B6) -LEN (SUBSTITUTE (B6, ":", ""))): replace the last separating colon with the new character $, SUBSTITUTE function allows to replace the specified character in the string.
- SEARCH ("$", SUBSTITUTE (B6, ":", "$", LEN (B6) -LEN (SUBSTITUTE (B6, ":", "")))): determine the location of the final separator , in the colon image, is replaced with the $ sign.
- RIGHT (B6, LEN (B6) -SEARCH ("$", SUBSTITUTE (B6, ":", "$", LEN (B6) -LEN (SUBSTITUTE (B6, ":", ""))))): Returns the string to the right of the last separator, taking the total string length minus the position of the delimiter.
The result is a sequence of characters as shown below.
I wish you all success!
You should read it
- How to use the LEN function in Excel
- How to use Excel's VALUE function
- How to use ConcateNate function on Excel
- Instructions on how to count words in cells in Excel
- How to use MID functions to get strings in Excel
- Find, FindB functions in Excel - The function finds a text string in another document in Excel
- The function takes a string in Excel
- How to use the Search function in Excel
May be interested
- How to use the FIND function in Excel?the find function in excel is a function that finds characters in a text string, having the same purpose as string separators like the mid function in excel or the left function or the right function.
- 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.
- MID and MIDB functions to cut strings in Excelthe mid () function returns a string from a text string, with the position to start extracting from the text string and the number of characters returned by the string that is specified. functions used in languages use a single-byte character set (sbcs) and always count each character as 1.
- Basic Excel functions that anyone must knowthe basic functions in excel such as the excel function, the excel statistics function we summarized below will be very helpful for you who often have to work on excel spreadsheets, especially in the field of accounting. let's refer to offline.
- LEN function in SQL Serverthe len function in sql server returns the length of the specified string. it is important that the len function does not include whitespace characters at the end of the string when calculating length.
- How to use Hlookup function on Excelhlookup function basically also has the function syntax and features like vlookup function, which is to help users find data in excel table, with the conditions or given information. here is the guide for using the hlookup function in detail.