Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 125
Default Convert Full Name to multiple cells

Hi, I want to get FirstName, LastName, and Title as separate cells. The
data is not all exactly the same:

Napolitano, Mr. Frank
Curtian, Chris

I guess I need some sort of test for Title (Mr. Mrs.) (looking for a period?)

TIA!

  #2   Report Post  
Posted to microsoft.public.excel.misc
JB JB is offline
external usenet poster
 
Posts: 115
Default Convert Full Name to multiple cells

With functions in a module:

http://cjoint.com/?bvtxLDRI1z

Function LastName(c)
a = Split(c, ",")
LastName = a(0)
End Function

Function FirstName(c)
a = Split(c, ",")
P = InStr(a(1), ".")
If P = 0 Then
FirstName = Trim(a(1))
Else
FirstName = Trim(Mid(a(1), P + 1))
End If
End Function

Function Title(c)
a = Split(c, ",")
P = InStr(a(1), ".")
If P = 0 Then
Title = ""
Else
Title = Trim(Mid(a(1), 1, P - 1))
End If
End Function

JB
http://boisgontierjacques.free.fr



On 19 jan, 18:39, Karin wrote:
Hi, *I want to get FirstName, LastName, and Title as separate cells. *The
data is not all exactly the same:

Napolitano, Mr. Frank
Curtian, Chris

I guess I need some sort of test for Title (Mr. Mrs.) (looking for a period?)

TIA!


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Convert Full Name to multiple cells

If your data is in column A, we will use column B for the title, column C for
the first name, column D for the lastname, and column E as a "helper" column.


In D1 enter:
=LEFT(A1,FIND(",",A1)-1) displays the lastname
In E1 enter:
=MID(A1,FIND(" ",A1)+1,255) displays title and first name
In B1 enter:
=IF(ISERROR(FIND(" ",E1)),"",LEFT(E1,FIND(" ",E1))) displays title (if its
there)
In C1 enter:
=IF(ISERROR(FIND(" ",E1)),E1,RIGHT(E1,FIND(" ",E1)+1)) displays firstname
--
Gary''s Student - gsnu200827


"Karin" wrote:

Hi, I want to get FirstName, LastName, and Title as separate cells. The
data is not all exactly the same:

Napolitano, Mr. Frank
Curtian, Chris

I guess I need some sort of test for Title (Mr. Mrs.) (looking for a period?)

TIA!

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 125
Default Convert Full Name to multiple cells

PERFECT! Thank you.

"Gary''s Student" wrote:

If your data is in column A, we will use column B for the title, column C for
the first name, column D for the lastname, and column E as a "helper" column.


In D1 enter:
=LEFT(A1,FIND(",",A1)-1) displays the lastname
In E1 enter:
=MID(A1,FIND(" ",A1)+1,255) displays title and first name
In B1 enter:
=IF(ISERROR(FIND(" ",E1)),"",LEFT(E1,FIND(" ",E1))) displays title (if its
there)
In C1 enter:
=IF(ISERROR(FIND(" ",E1)),E1,RIGHT(E1,FIND(" ",E1)+1)) displays firstname
--
Gary''s Student - gsnu200827


"Karin" wrote:

Hi, I want to get FirstName, LastName, and Title as separate cells. The
data is not all exactly the same:

Napolitano, Mr. Frank
Curtian, Chris

I guess I need some sort of test for Title (Mr. Mrs.) (looking for a period?)

TIA!

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
How do I convert number into full text amount HONG KONG CHE Excel Discussion (Misc queries) 1 April 28th 07 07:16 PM
How do I convert number into full text amount HONG KONG CHE[_2_] Excel Discussion (Misc queries) 1 April 28th 07 07:14 PM
ASC() does not convert full-width to half-width letters (Exel 2003 DY Excel Worksheet Functions 0 January 27th 07 01:34 PM
SumIF full columns, multiple conditions Gupta A. Excel Discussion (Misc queries) 3 May 23rd 06 09:06 PM
How to convert a hyperlink to its target full-text URL Excel Discussion (Misc queries) 2 July 7th 05 01:40 PM


All times are GMT +1. The time now is 05:15 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"