Tuesday, February 18, 2020

RIGHT Function in Excel with Example

RIGHT ()

This function displays a specified number of characters from the right hand side of a piece of text or number.

Best view in desktop mode.


A
B
C
D
E
1
Text
Number Of
Characters Required
RIGHT String
2
Alan Jones
5
Jones
 =RIGHT(A2,B2)
3
Alan Jones
4
ones
 =RIGHT(A3,B3)
4
Alan Jones
3
nes
 =RIGHT(A4,B4)
5
Cardiff
2
ff
 =RIGHT(A5,B5)
6
ABC123
1
3
 =RIGHT(A6,B6)
7
8
9
10
Type "No of Characters Required" in Function
11
Incorrect No
Correct Mobile No
12
919871526345
9871526345
 =RIGHT(A12,10)
13
+91-9891236485
9891236485
 =RIGHT(A13,10)
14
09910652868
9910652868
 =RIGHT(A14,10)
15
+91-8077568526
8077568526
 =RIGHT(A15,10)
16
919873235689
9873235689
 =RIGHT(A16,10)
17
18
19


Syntax

=RIGHT(OriginalText, NumberOfCharactersRequired)

=RIGHT(text, [num_char])


Formatting


No special formatting is needed.



For example

In below example, we will use right function with find and len function. The following table was used to extract the last name of a person from their full name.


A
B
C
D
E
1
Full Name
First Name
2
Alan Jones
Jones
 =RIGHT(A2,LEN(A2)-FIND(" ",A2))
3
Bob Smith
Smith
 =RIGHT(A3,LEN(A3)-FIND(" ",A3))
4
Carol Williams
Williams
 =RIGHT(A4,LEN(A4)-FIND(" ",A4))

In the above example, there is name like Carol Williams. And we have to extract last name, so we will use right function. But how we will define the number of char for extracting from right side?

For this, we will first calculate total length of the Full Name by using LEN () function.
Like [LEN (A2)], so it will give result 14.

Then we will find the space position number by using FIND () function.
Like [FIND (" ", A2)], so it will give result 6.

Then minus FIND () value from LEN () function value, so you will find the last name character length.
Like [LEN (A2)] - [FIND (" ", A2)] = 14 – 6 = 8

Now, you can use this combined function in RIGHT () function.

Like = RIGHT (A2 , LEN (A2) FIND (" ", A2) ) = Williams





                       




No comments:

Post a Comment