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 / January 2006

Tip: Looking for answers? Try searching our database.

Extracting Last and First name fro Cell

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
fbacchus - 28 Jan 2006 16:23 GMT
Hi:

I have a cell containing Last and First Name. In most cases the
Lastname and Firstname are seperated by a comma. Also in this same
field there is a telephone number which can be in several different
formats (e.g (718-xxx-xxxx) or 718-xxx-xxxx)). I would like to extract
the phone number from this "Name" cell, leaving just the lastname and
the firstname. Seperating the names would be a bonus but I don't think
is possible, as there is no set patterns.

For the telephone number, there is another cell with telephone numbers
which is sometimes blank. What I'd like to do is, if I can extrapulate
the telephone number (formating it as 718-xx-1212) and place it in the
"telephone number cell", only if that cell is blank. This would be my
ultimate goal. Any help would be appreciated.

thanks

frank

Signature

fbacchus

Beege - 28 Jan 2006 16:40 GMT
fbacchus,

Try:

Copy column to blank area, perhaps new sheet
Select Column
Use Data/Text to Columns, follow clues there
HTH

Beege

> Hi:
>
[quoted text clipped - 15 lines]
>
> frank
Ron Rosenfeld - 28 Jan 2006 17:59 GMT
>Hi:
>
[quoted text clipped - 15 lines]
>
>frank

Do you want the results to be in the same cells as the entries?  Or can they be
in adjacent columns.

If the latter, then, with your Name String in A1 and possible phone number in
B1, do the following:

1.  Download and install Longre's free morefunc.xll add in from:

C1:  Remove the phone number from the string
    =REGEX.SUBSTITUTE(A1,"\d{3}-\d{3}-\d{4}")

D1:  Extract phone number from string unless there is something in B1
    =IF(B1="",REGEX.MID(A1,"\d{3}-\d{3}-\d{4}"),B1)

If the former, then you can either copy/paste values the results of the above
formulas over columns A&B, or use a VBA macro.

--ron
Ron Rosenfeld - 28 Jan 2006 18:32 GMT
>>Hi:
>>
[quoted text clipped - 32 lines]
>If the former, then you can either copy/paste values the results of the above
>formulas over columns A&B, or use a VBA macro.

Actually, if you need the results in the same cells, you cannot copy/paste
because that would destroy anything in B1.  You will need a VBA macro is that
is a requirement.

If that is what you need, it will be simple to design one.
--ron
 
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.