Extract text from the right of a string
=RIGHT(text, [num_chars])
| Parameter | Description |
|---|---|
text |
The text from which to extract characters on the right. |
num_chars |
[optional] The number of characters to extract, starting on the right. Default = 1. |
To extract text with RIGHT, just provide the text and the number of characters to extract. The formulas below show how to extract one, two, and three
=RIGHT("apple",1) // returns "e"
=RIGHT("apple",2) // returns "le"
=RIGHT("apple",3) // returns "ple"
If the optional argument num_chars is not provided, it defaults to 1:
=RIGHT("ABC") // returns "C"
If num_chars exceeds the length of the text string, RIGHT returns the entire string:
=RIGHT("apple",100) // returns "apple"
When RIGHT is used on a numeric value, the result is text:
=RIGHT(1500,3) // returns "500" as text
The RIGHT function can be used to extract a specific number of characters from the end of a text string. For example, to extract the last two characte
=RIGHT("Los Angeles, CA",2) // returns "CA"
Of course, it doesn't make sense to extract text from a text string that you have to type into a formula. A more typical example is to work with value
=RIGHT(B5,2)