Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 37
Default Two question on working with text

In Excel 2007, Column C has a list of 3500 names in the format of FirstName
LastName, but unfortuately the are approximately 1200 also have a middle
intitial, some with a period and some without a period. As is evident, this
list was compiled over a period of about 2 years and many people contributed
to it with no guidlines, and now I have been directed to fix it.

Question 1 - Can a formula be devised to extract the first four letters of
the last name?
Question 2 - Is there a means to put a period after those middle initials
that do not have one
Thank you
Marsh
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,722
Default Two question on working with text

Answer 1:
=MID(A2,FIND(" ",A2,IF(LEN(A2)-LEN(SUBSTITUTE(A2," ",""))=2,FIND("
",A2)+1,1))+1,4)

Answer 2:
=IF(OR(ISNUMBER(FIND(".",A2)),LEN(A2)-LEN(SUBSTITUTE(A2,"
",""))=1),A2,REPLACE(A2,FIND(" ",A2)+2,1,". "))
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Marsh" wrote:

In Excel 2007, Column C has a list of 3500 names in the format of FirstName
LastName, but unfortuately the are approximately 1200 also have a middle
intitial, some with a period and some without a period. As is evident, this
list was compiled over a period of about 2 years and many people contributed
to it with no guidlines, and now I have been directed to fix it.

Question 1 - Can a formula be devised to extract the first four letters of
the last name?
Question 2 - Is there a means to put a period after those middle initials
that do not have one
Thank you
Marsh

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,766
Default Two question on working with text

Hi,

Try this to get the first four characters of the last name (Name assumed to
be in cell B4)

=left(trim(right(substitute(B2," ",rept(" ",99)),20)),4)

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com

"Marsh" wrote in message
...
In Excel 2007, Column C has a list of 3500 names in the format of
FirstName
LastName, but unfortuately the are approximately 1200 also have a middle
intitial, some with a period and some without a period. As is evident,
this
list was compiled over a period of about 2 years and many people
contributed
to it with no guidlines, and now I have been directed to fix it.

Question 1 - Can a formula be devised to extract the first four letters of
the last name?
Question 2 - Is there a means to put a period after those middle initials
that do not have one
Thank you
Marsh


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
format numbers as text - not working Urs Excel Discussion (Misc queries) 3 August 26th 09 05:24 PM
Wrap Text not working in places Nick Wakeham Excel Discussion (Misc queries) 2 January 15th 09 06:06 PM
Text join formulas working but act as straight text when modified akkrug New Users to Excel 3 May 14th 08 02:27 PM
Text to Numbers NOT working BON Excel Discussion (Misc queries) 4 November 24th 06 11:39 AM
Another Working day question! neway9 Excel Discussion (Misc queries) 4 July 11th 06 03:26 PM


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