Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / December 2004

Tip: Looking for answers? Try searching our database.

Extracting Last Name and First Initial

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ruan - 17 Dec 2004 20:13 GMT
Hello,

I need to extract the Last Name and the First Initial of a person's full
name. The person's full name is written in this format: Last Name, First
Name.

Example:
Bond, James   =   Bond  and  J

However, sometimes the full name format isn't always as we require it. We
have come across the following scenarios -
1) Bond , James    (error - space before the comma)
2) Bond,James      (error - no space after the comma)
3) Bond,  James    (error - 2 spaces after the comma instead of one)
4) Bond James      (error - no comma)

Does anyone know the formula I can use to always extract the Last Name and
the First Initial regardless if the full name format is incorrect?

Some names might have Middle Initial and will be in this format - Bond,
James N.

Thanks
Ruan
Frank Kabel - 17 Dec 2004 20:24 GMT
Hi
try
1. Last name:
=IF(ISNUMBER(FIND(",",A1)),TRIM(LEFT(A1,FIND(",",A1)-1)),TRIM(LEFT(A1,FIND("
",A1)-1)))

2. Initial:
=LEFT(IF(ISNUMBER(FIND(",",A1)),TRIM(MID(A1,FIND(",",A1)+1,255)),TRIM(MID(A1,FIND("
",A1)+1,255))),1)

Signature

Regards
Frank Kabel
Frankfurt, Germany

> Hello,
>
[quoted text clipped - 20 lines]
> Thanks
> Ruan
Ruan - 17 Dec 2004 23:23 GMT
Thanks,

Both formulas work great.

> Hi
> try
[quoted text clipped - 30 lines]
>> Thanks
>> Ruan
Peo Sjoblom - 17 Dec 2004 20:30 GMT
Last Name

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

First

=TRIM(IF(ISERR(FIND(",",A1)),MID(A1,FIND("
",A1),255),MID(A1,FIND(",",A1)+1,255)))

Regards,

Peo Sjoblom

> Hello,
>
[quoted text clipped - 20 lines]
> Thanks
> Ruan
Peo Sjoblom - 17 Dec 2004 20:33 GMT
Opps! Change the second formula to

=LEFT(TRIM(IF(ISERR(FIND(",",A1)),MID(A1,FIND("
",A1),255),MID(A1,FIND(",",A1)+1,255))))

Regards,

Peo Sjoblom

> Last Name
>
[quoted text clipped - 33 lines]
> > Thanks
> > Ruan
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.