Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 125
Default 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)
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,311
Default 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)



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,886
Default 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)



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
find a variable text string [email protected] Excel Discussion (Misc queries) 2 January 30th 07 07:20 PM
3 variable find and replace ncspndoc Excel Discussion (Misc queries) 4 June 30th 06 09:07 PM
How do I find the last row of data and then use that as a variable Lynn Bales New Users to Excel 3 August 4th 05 12:51 PM
Variable control tip text Steve Excel Discussion (Misc queries) 3 June 30th 05 03:48 PM
Putting text in a column based on variable text from another colum Jacky D. Excel Discussion (Misc queries) 1 December 16th 04 06:09 PM


All times are GMT +1. The time now is 05:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"