ID EN
#Text

RIGHT

Excel Functions

Extract text from the right of a string

Syntax

EXCEL
=RIGHT(text, [num_chars])

Arguments

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.

Return Value

One or more characters.

Details

The RIGHT function extracts a given number of characters from the right side of a supplied text string. The first argument, text, is the text string to extract from. This is typically a reference to a cell that contains text. The second argument, called num_chars, specifies 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. Although RIGHT is a simple function, it shows up in many more advanced formulas that test or manipulate text in a specific way. 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 characters with RIGHT: If the optional argument num_chars i

Examples

RIGHT function basics

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

EXCEL
=RIGHT("apple",1) // returns "e"
=RIGHT("apple",2) // returns "le"
=RIGHT("apple",3) // returns "ple"
RIGHT function basics

If the optional argument num_chars is not provided, it defaults to 1:

EXCEL
=RIGHT("ABC") // returns "C"
RIGHT function basics

If num_chars exceeds the length of the text string, RIGHT returns the entire string:

EXCEL
=RIGHT("apple",100) // returns "apple"
RIGHT function basics

When RIGHT is used on a numeric value, the result is text:

EXCEL
=RIGHT(1500,3) // returns "500" as text
Example - extract state abbreviation

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

EXCEL
=RIGHT("Los Angeles, CA",2) // returns "CA"
Example - extract state abbreviation

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

EXCEL
=RIGHT(B5,2)

See Also

LEFT MID LEN TEXTBEFORE TEXTAFTER TEXTSPLIT