Right() function



The Excel RIGHT function extracts a given number of characters from the right side of a supplied text string.

Syntax

The syntax for the RIGHT function in Microsoft Excel is:
RIGHT( text, [num_chars] )

Parameters or Arguments

text

The string that you wish to extract from.

num _chars

Optional. It indicates the number of characters that you wish to extract starting from the right-most character. If this parameter is omitted, only 1 character is returned.

Usage notes

·         Use the RIGHT function when you want to extract characters starting at the right side of text.
·         num_chars is optional and defaults to 1.
·         RIGHT will extract digits from numbers as well.
·         Number formatting is not part of a text and will not be extracted or counted.

Right Function Examples

Column B of the spreadsheet below shows three examples of the Excel Right function.

Formulas:


A
B
1
Original Text
=RIGHT( A1 )
2
Original Text
=RIGHT( A2, 4 )
3
The Number 5
=RIGHT( A3, 1 )

Results:


A
B
1
Original Text
t
2
Original Text
Text
3
The Number 5
5

Note that in the above examples:
-          The function in cell B1 omits the [num_chars] argument and so in this case, [num_chars] is set to the default value 1.
-          In cell B3, the right function returns the text value "5" (not the numeric value).

Reference :


No comments:

Post a Comment

OR Function