To extract the characters from right side from a text string based on the no of character specified
Syntax
RIGHT(text,num_chars)
How to extract last name where last name is having different number of letters in different cells
B | C | D | |
22 | Names | Last name | Formula |
23 | Rajeev Sharma | Sharma | =RIGHT(B23,LEN(B23)-FIND(" ",B23)) |
24 | Rohit Bansal | Bansal | =RIGHT(B24,LEN(B24)-FIND(" ",B24)) |
25 | Amit shrivastava | shrivastava | =RIGHT(B25,LEN(B25)-FIND(" ",B25)) |
Len Function returns the length of selected text and finds the position of selected characters (Space)
Now to get no of letters after space just subtract the find length from total length
Let see how we did it
Rajeev Sharma | Sharma | =RIGHT(B23,LEN(B23)-FIND(" ",B23)) |
Total Length | 13 | |
Length till space | 7 | |
Last name letters | 13-7 = | 6 (Sharma) |
No comments:
Post a Comment