Excel RIGHT Function

Using the Excel RIGHT Function


The RIGHT function returns the last character(s) in a text string, based on the number of characters specified by the user. The RIGHTB function can also be used, which returns the last character(s) in a text sting based on the number of bytes specified by the user.

RIGHT should be used with single-byte character set (SBCS) languages. RIGHTB should be used with double-byte character set (DBCS) languages, such as Japanese, Chinese (Simplified and Traditional), or Korean.

RIGHT always counts each character as 1, regardless of the default language setting. RIGHTB will count each DBCS as 2 when using a DBCS language, otherwise it functions the same as RIGHT.


=RIGHT (text, [num_chars])

=RIGHTB (text, [num_bytes])

Syntax Breakdown

Required for both RIGHT and RIGHTB. The text string that contains the characters you wish to extract.

Num Chars
Optional. The number of characters you want the function to extract. If specified, num_chars must be greater than or equal to zero. If omitted, it is assumed to be 1. If the argument is greater than the length of text, RIGHT returns the entire text.

Num Bytes
Optional. The number of characters, based on bytes, the function will return.

Usage Notes

RIGHT and RIGHTB extract a user specified number of characters from the right of a text string. Both functions can extract digits from numbers.

Number formatting (i.e. symbols such as $) will not be extracted or counted.