RIGHT

RIGHT(text [,num_chars])

Returns the last or right most characters in a text string.

textThe text string that contains the characters you want to extract.
num_chars(Optional) The number of characters you want to extract.

REMARKS
* If "text" is a text string then it must be enclosed in speech marks.
* The "text" can be numbers.
* The "text" can be cell reference.
* If "num_chars" > the length of the "text", then "text" is returned.
* If "num_chars" is left blank, then 1 is used.
* If "num_chars" is not numerical, then #VALUE! is returned.
* If "num_chars" < 0, then #VALUE! is returned.
* Any blank spaces are counted as individual characters.
* If more than one cell is referenced then a Dynamic Array Formula will be applied.
* You can use the LEFT function to return the first or left most characters in a text string.
* You can use the TEXTAFTER function to return the characters from the end of a text string after a delimiter.
* You can use the TEXTSPLIT function to return the text string split into multiple columns using delimiters.
* You can use the TRIM function to return a text string with all spaces removed from the beginning, middle and end.
* You can use the RIGHTB function if you have languages that use the double-byte character set.
* The equivalent VBA function is VBA.RIGHT
* For the Microsoft documentation refer to support.microsoft.com
* For the Google documentation refer to support.google.com

 AB
1=RIGHT("Better Solutions", 9) = Solutionssome text
2=RIGHT("Better", 1) = rmore
3=RIGHT("Better",0) = blank celltext
4=RIGHT("Solutions", 1) = s 
5=RIGHT("Be More Productive", 15) = More Productive 
6=RIGHT("Be More Productive", 100) = Be More Productive 
7=RIGHT("wword ",5) = "word " 
8=RIGHT(TRIM("wword "), 5) = wword 
9=RIGHT(12345, 2) = 45 
10=RIGHT(B1, 4) = text 
11=RIGHT(B1:B3,4) = { text , more , text } 
12=RIGHT(Invalid,5) = #NAME? 
13=RIGHT("Better Solutions", -50) = #VALUE! 
14=RIGHT("Better Solutions", "some text") = #VALUE! 

1 - What are the 9 characters on the right of this text string.
2 - What is the last character of this text string.
3 - When the number of characters is zero an empty string (or blank cell) is returned.
4 - What is the last character of this text string.
5 - What are the 15 characters on the right of this text string.
6 - What are the 100 characters on the right of this text string.
7 - What are the 5 characters on the right of this text string. Blank spaces are counted.
8 - What are the 5 characters on the right of this text string after all spaces have been removed.
9 - What are the last 2 digits of this number.
10 - What are the 4 characters on the right of the text in cell "B1".
11 - What are the 4 characters on the right of the text in cells "B1:B3". This is an example of a Dynamic Array Formula.
12 - When a text string, number or cell reference is not passed in.
13 - When the number of characters is less than 0.
14 - When the number of characters is not a number.

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited Top