## Monday, 13 August 2012

### Excel RIGHT Function Syntax and Example

MS Excel RIGHT Function:
RIGHT  Function is similar to LEFT Function , returns the first character or characters from right side in a text string or number, based on the number of characters that you specified.
Ø       RIGHT always counts each character, whether single-byte or double-byte, as 1.
Syntax:
=RIGHT(String, Num_of_chars)
String is the text/number that contains the characters you want to extract.
Num_of_chars   specifies the number of characters you want  to extract from RIGHT side of the string.
Ø       Num of chars must be greater than or equal to zero.
Ø       If Num of chars is greater than the length of text, RIGHT returns all of text.
Example:

 STRING RIGHT FORMULA RESULT Ravi-Teja@Reddy =RIGHT(A2,5) Reddy Ravi-Teja@Reddy =RIGHT(A3, LEN(A3)-FIND("-",A3)) Teja@Reddy 123ABC#cde345 =RIGHT(A4, LEN(A4)-FIND("c",A4)+1) cde345 123ABC#cde346 =RIGHT(A5, LEN(A5)-SEARCH("c",A5)+1) C#cde346

Explanation :
=RIGHT(A2,5)
This function returns the 5 characters from the right side of the string in A2.

=RIGHT(A5, LEN(A5)-SEARCH("c",A5)+1)
Here in this case we find the No.of characters to extract with SEARCH Function.

Please be note that Find is a case sensitive function but Search is not.

Thanks,
TAMATAM