RIGHT(Text, Number_chars)
where,
- Text is a text string containing characters to extract,
- Number_chars represents the number of characters to be extracted.
RIGHT() displays the last character or characters from a text string, depending on the specified number of characters.
Description
RIGHT(txt)
e.g. RIGHT("String",2) displays ng as a result.
- RIGHT counts 1 byte per character. RIGHT works with the languages that use 'Single Byte Character Set' (SBCS).
- Text can be any string containing characters, numbers, symbols, blank spaces etc.
- If argument Text is directly entered in the command, it should be enclosed in double quotes (e.g. "Name").
- Argument Number_chars indicates the number of characters to be displayed from a text string. Number_chars should be >0.
- If Number_chars >'length of text', Calci displays all the text.
- If Number_chars is omitted, Calci assumes it to be 1.
Examples
Consider the following examples as input to RIGHT() function.
Wel-Come | ||
JOHN SMITH | ||
123*123 | ||
=RIGHT(A1,5) : Displays last 5 characters in a string from cell A1. Displays -Come as the output. =RIGHT(A2,8) : Displays last 8 characters in a string from cell A2. Displays HN SMITH as the output. Space Character is also counted. =RIGHT(A3,9) : Displays all characters in a string from cell A3. Displays 123*123 as the output. =RIGHTB(A3) : Displays last character in a string from cell A3. Displays 3 as the output. =RIGHT("Good Morning",7) :Displays Morning as the output.