Excel RIGHT Function
The Excel RIGHT function extracts a given number of characters from the right side of a supplied text string. For example, RIGHT("apple",3) returns "ple".
- text - The text from which to extract characters on the right.
- num_chars - [optional] The number of characters to extract, starting on the right. Optional, default = 1.
The RIGHT function extracts a given number of characters from the right side of a supplied text string. The second argument, called num_chars, controls the number of characters to extract. If num_chars is not provided, it defaults to 1. If num_chars is greater than the number of characters available, RIGHT returns the entire text string.
In the example below, we extract the state code "OR" (Oregon) from the string "Portland, OR"
=RIGHT("Portland, OR",2) // returns "OR"
If the optional argument num_chars is not provided, it defaults to 1:
=RIGHT("ABC") // returns "C"
- num_chars is optional and defaults to 1.
- RIGHT will extract digits from numbers as well as text.
- Number formatting is not counted or extracted.