ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Right Text - Variable Find (https://www.excelbanter.com/excel-discussion-misc-queries/145604-right-text-variable-find.html)

Karin

Right Text - Variable Find
 
Hi, I was trying to extract a variable amount of information from the right
in a text cell. I saw a response that used programming, but I'm not a
programmer. I found this method:

Smith, Joe (in column A, line 2)

To get the last name (in column B, line 2): =MID(A2,1,FIND(",",A2,1)-1)
(Returns Smith)

To get the first name is trickier -- I needed three additional columns to
get it.
Column D, Line 2 =LEN(A2) (returns 10)
Column E, Line 2 =FIND(",",A2,1)+1 (returns 7)
Column F, Line 2 =D2-E2 (returns 3)

In Column C (where I want the first name) =RIGHT(A2,F2)

PCLIVE

Right Text - Variable Find
 
With the name in A1:
To get the first name:
=RIGHT(A1,LEN(A1)-(FIND(",",A1)+1))

To get the last name:
=LEFT(A1,FIND(",",A1)-1)

HTH,
Paul

"Karin" wrote in message
...
Hi, I was trying to extract a variable amount of information from the
right
in a text cell. I saw a response that used programming, but I'm not a
programmer. I found this method:

Smith, Joe (in column A, line 2)

To get the last name (in column B, line 2): =MID(A2,1,FIND(",",A2,1)-1)
(Returns Smith)

To get the first name is trickier -- I needed three additional columns to
get it.
Column D, Line 2 =LEN(A2) (returns 10)
Column E, Line 2 =FIND(",",A2,1)+1 (returns 7)
Column F, Line 2 =D2-E2 (returns 3)

In Column C (where I want the first name) =RIGHT(A2,F2)




Roger Govier

Right Text - Variable Find
 
Hi Karin

You can combine all those into one formula if you wish
=RIGHT(A2,LEN(A2)-FIND(",",A2,1)+1)
or you could use
=MID(A2,FIND(",",A2,1)+1,255)


--
Regards

Roger Govier


"Karin" wrote in message
...
Hi, I was trying to extract a variable amount of information from the
right
in a text cell. I saw a response that used programming, but I'm not a
programmer. I found this method:

Smith, Joe (in column A, line 2)

To get the last name (in column B, line 2):
=MID(A2,1,FIND(",",A2,1)-1)
(Returns Smith)

To get the first name is trickier -- I needed three additional columns
to
get it.
Column D, Line 2 =LEN(A2) (returns 10)
Column E, Line 2 =FIND(",",A2,1)+1 (returns 7)
Column F, Line 2 =D2-E2 (returns 3)

In Column C (where I want the first name) =RIGHT(A2,F2)





All times are GMT +1. The time now is 08:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com