Using the Excel RIGHT Function
SummaryThe 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.
Syntax=RIGHT (text, [num_chars])
=RIGHTB (text, [num_bytes])
Required for both RIGHT and RIGHTB. The text string that contains the characters you wish to extract.
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.
Optional. The number of characters, based on bytes, the function will return.
Usage NotesRIGHT 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.