Summary

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".

Purpose 

Extract text from the right of a string

Return value 

One or more characters.

Syntax

=RIGHT(text,[num_chars])
  • 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.

How to use 

The RIGHT function extracts a given number of characters from the right side of a supplied text string. 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.

Examples

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"

If num_chars exceeds the string length, LEFT returns the entire string:

=RIGHT("apple",100) // returns "apple"

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

=RIGHT(1200,3) // returns "200" as text

The RIGHT function is often combined with other functions like LEN and FIND to extract text in more complex formulas. For example, to extract text in cell A1 to the right of a specific character (char), use RIGHT with the FIND and LEN functions like this:

=RIGHT(A1,LEN(A1)-FIND(char,A1)) // text to right char

FIND returns the position of the character, and RIGHT returns the text to the right of that position.  Full explanation here.

Related functions

The RIGHT function is used to extract text from the right side of a text string. Use the LEFT function to extract text starting from the left side of the text, and the MID function to extract from the middle of the text. The LEN function returns the length of text as a count of characters.

Notes

  • 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.
Dave Bruns Profile Picture

AuthorMicrosoft Most Valuable Professional Award

Dave Bruns

Hi - I'm Dave Bruns, and I run Exceljet with my wife, Lisa. Our goal is to help you work faster in Excel. We create short videos, and clear examples of formulas, functions, pivot tables, conditional formatting, and charts.