Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
Ruan
 
Posts: n/a
Default Extracting First Name

Hello,

I was able to extract the Last Name from a string, however I am having
difficulties extracting the First Name, especially when there is a Middle
Initial involved.

Example: Bond, James P.

I just need to extract "James".

Here is my formula I used for extracting the Last Name -
=UPPER(IF(ISNUMBER(FIND(",",A1)),TRIM(LEFT(A1,FIND (",",A1)-1)),TRIM(LEFT(A1,FIND("
",A1)-1))))


Thanks
Ruan



  #2   Report Post  
Posted to microsoft.public.excel.newusers
CLR
 
Posts: n/a
Default Extracting First Name

=MID(A1,FIND(" ",A1,1)+1,FIND(" ",A1,FIND(" ",A1,1)+1)-FIND(" ",A1,1)-1)

Vaya con Dios,
Chuck, CABGx3



"Ruan" wrote:

Hello,

I was able to extract the Last Name from a string, however I am having
difficulties extracting the First Name, especially when there is a Middle
Initial involved.

Example: Bond, James P.

I just need to extract "James".

Here is my formula I used for extracting the Last Name -
=UPPER(IF(ISNUMBER(FIND(",",A1)),TRIM(LEFT(A1,FIND (",",A1)-1)),TRIM(LEFT(A1,FIND("
",A1)-1))))


Thanks
Ruan




  #3   Report Post  
Posted to microsoft.public.excel.newusers
Ruan
 
Posts: n/a
Default Extracting First Name

I am getting "#VALUE!" error.


"CLR" wrote in message
...
=MID(A1,FIND(" ",A1,1)+1,FIND(" ",A1,FIND(" ",A1,1)+1)-FIND(" ",A1,1)-1)

Vaya con Dios,
Chuck, CABGx3



"Ruan" wrote:

Hello,

I was able to extract the Last Name from a string, however I am having
difficulties extracting the First Name, especially when there is a Middle
Initial involved.

Example: Bond, James P.

I just need to extract "James".

Here is my formula I used for extracting the Last Name -
=UPPER(IF(ISNUMBER(FIND(",",A1)),TRIM(LEFT(A1,FIND (",",A1)-1)),TRIM(LEFT(A1,FIND("
",A1)-1))))


Thanks
Ruan






  #4   Report Post  
Posted to microsoft.public.excel.newusers
CLR
 
Posts: n/a
Default Extracting First Name

The formula will return #VALUE! if cell A1 is empty, or if it contains a
number. I understood it was to contain something like "Bond, James P.", and
you wanted only the "James" part extracted. It's a fairly long formula,
perhaps email word-wrap messed it up......it all goes in one cell.

Vaya con Dios,
Chuck, CABGx3



"Ruan" wrote:

I am getting "#VALUE!" error.


"CLR" wrote in message
...
=MID(A1,FIND(" ",A1,1)+1,FIND(" ",A1,FIND(" ",A1,1)+1)-FIND(" ",A1,1)-1)

Vaya con Dios,
Chuck, CABGx3



"Ruan" wrote:

Hello,

I was able to extract the Last Name from a string, however I am having
difficulties extracting the First Name, especially when there is a Middle
Initial involved.

Example: Bond, James P.

I just need to extract "James".

Here is my formula I used for extracting the Last Name -
=UPPER(IF(ISNUMBER(FIND(",",A1)),TRIM(LEFT(A1,FIND (",",A1)-1)),TRIM(LEFT(A1,FIND("
",A1)-1))))


Thanks
Ruan







  #5   Report Post  
Posted to microsoft.public.excel.newusers
Ruan
 
Posts: n/a
Default Extracting First Name

Sorry, I should have been more specific. Not all the names have a Middle
Initial. So, when I don't have a middle initial (Bond, James), your formula
displays an error. Otherwise, it works perfectly for the names with a Middle
Initial.

Ruan


"CLR" wrote in message
...
The formula will return #VALUE! if cell A1 is empty, or if it contains a
number. I understood it was to contain something like "Bond, James P.",
and
you wanted only the "James" part extracted. It's a fairly long formula,
perhaps email word-wrap messed it up......it all goes in one cell.

Vaya con Dios,
Chuck, CABGx3



"Ruan" wrote:

I am getting "#VALUE!" error.


"CLR" wrote in message
...
=MID(A1,FIND(" ",A1,1)+1,FIND(" ",A1,FIND(" ",A1,1)+1)-FIND("
",A1,1)-1)

Vaya con Dios,
Chuck, CABGx3



"Ruan" wrote:

Hello,

I was able to extract the Last Name from a string, however I am having
difficulties extracting the First Name, especially when there is a
Middle
Initial involved.

Example: Bond, James P.

I just need to extract "James".

Here is my formula I used for extracting the Last Name -
=UPPER(IF(ISNUMBER(FIND(",",A1)),TRIM(LEFT(A1,FIND (",",A1)-1)),TRIM(LEFT(A1,FIND("
",A1)-1))))


Thanks
Ruan











  #6   Report Post  
Posted to microsoft.public.excel.newusers
Bob Phillips
 
Posts: n/a
Default Extracting First Name

Try

=MID(A1,FIND(" ",A1)+1,FIND(" ",A1&" ",FIND(" ",A1)-FIND(" ",A1)+1)-1)

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Ruan" wrote in message
...
Sorry, I should have been more specific. Not all the names have a Middle
Initial. So, when I don't have a middle initial (Bond, James), your

formula
displays an error. Otherwise, it works perfectly for the names with a

Middle
Initial.

Ruan


"CLR" wrote in message
...
The formula will return #VALUE! if cell A1 is empty, or if it contains a
number. I understood it was to contain something like "Bond, James P.",
and
you wanted only the "James" part extracted. It's a fairly long formula,
perhaps email word-wrap messed it up......it all goes in one cell.

Vaya con Dios,
Chuck, CABGx3



"Ruan" wrote:

I am getting "#VALUE!" error.


"CLR" wrote in message
...
=MID(A1,FIND(" ",A1,1)+1,FIND(" ",A1,FIND(" ",A1,1)+1)-FIND("
",A1,1)-1)

Vaya con Dios,
Chuck, CABGx3



"Ruan" wrote:

Hello,

I was able to extract the Last Name from a string, however I am

having
difficulties extracting the First Name, especially when there is a
Middle
Initial involved.

Example: Bond, James P.

I just need to extract "James".

Here is my formula I used for extracting the Last Name -

=UPPER(IF(ISNUMBER(FIND(",",A1)),TRIM(LEFT(A1,FIND (",",A1)-1)),TRIM(LEFT(A1,
FIND("
",A1)-1))))


Thanks
Ruan











  #7   Report Post  
Posted to microsoft.public.excel.newusers
Ron de Bruin
 
Posts: n/a
Default Extracting First Name

Try this for the first word

=IF(ISERR(FIND(" ",A2)),A2,IF(RIGHT(LEFT(A2,FIND(" ",A2)-1))=",",LEFT(A2,FIND(" ",A2)-2),LEFT(A2,FIND(" ",A2)-1)))


Last word
=IF(ISERR(FIND(" ",A2)),A2,MID(A2,FIND("^^",SUBSTITUTE(A2," ","^^",LEN(A2)-LEN(SUBSTITUTE(A2," ",""))))+1,1024))


This Add-in make it easy to insert the formulas in a new column
http://www.rondebruin.nl/datarefiner.htm



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Ruan" wrote in message ...
Hello,

I was able to extract the Last Name from a string, however I am having difficulties extracting the First Name, especially when
there is a Middle Initial involved.

Example: Bond, James P.

I just need to extract "James".

Here is my formula I used for extracting the Last Name -
=UPPER(IF(ISNUMBER(FIND(",",A1)),TRIM(LEFT(A1,FIND (",",A1)-1)),TRIM(LEFT(A1,FIND(" ",A1)-1))))


Thanks
Ruan





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
extracting numbers from alphanumeric cells Mary Excel Worksheet Functions 6 February 22nd 07 12:04 PM
Extracting information from records to another sheet automatically Max Excel Worksheet Functions 0 February 4th 06 05:27 PM
Extracting data from Pivot gigi Excel Discussion (Misc queries) 6 November 23rd 05 05:25 PM
Extracting info from word and displaying in an excel spreadsheet Drew Excel Discussion (Misc queries) 0 March 7th 05 03:49 AM
Extracting Values on one list and not another B Schwarz Excel Discussion (Misc queries) 4 January 7th 05 01:48 PM


All times are GMT +1. The time now is 10:41 PM.

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"