Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
stapleton2308
 
Posts: n/a
Default Another, sort of trim question


Thanks for you help earlier (TWIMC)

If i have a list as follows:

SMITHMRD&MRSE
JONESMRF
ELLIOTMRM&MRSK
JOHNSMRS&MRSP

As you can see its's a surname 1st, then, ie its Mr S & Mrs K, is there
anyway this can be seperated so it looks like below?:

SMITH MRD&MRSE
JONES MRF
ELLIOT MRM&MRSK
JOHNS MRS&MRSP

Help much appricated!!!


--
stapleton2308
------------------------------------------------------------------------
stapleton2308's Profile: http://www.excelforum.com/member.php...o&userid=30878
View this thread: http://www.excelforum.com/showthread...hreadid=512709

  #2   Report Post  
Posted to microsoft.public.excel.misc
Cutter
 
Posts: n/a
Default Another, sort of trim question


For a start you could use:

=LEFT(A1,SEARCH("MR",A1)-1)&" "&RIGHT(A1,LEN(A1)-SEARCH("MR",A1)+1)

which works for the samples you gave but it wouldn't work for MS or
MISS


--
Cutter
------------------------------------------------------------------------
Cutter's Profile: http://www.excelforum.com/member.php...fo&userid=9848
View this thread: http://www.excelforum.com/showthread...hreadid=512709

  #3   Report Post  
Posted to microsoft.public.excel.misc
 
Posts: n/a
Default Another, sort of trim question

If you wish to look for more than one string

=SUMPRODUCT(IF(ISERROR(SEARCH({"miss","mr","ms"},M 8)),"",SEARCH({"miss","mr","ms"},M8)))
will return the location of the first occurance.
This could be sandwiched in a
=Replace(M8,Formula,0," ")
to insert a space

=Left(M8,Formula)
for the surname

=Right(M8,Len(M8)-Formula)
or
=Replace(M8,1,Formula-1,"")
for the Title and initials.

It will breakdown if you have more than one of the search strings in the
name.
Also I guess you have spotted that searching for a string is inherently
going to fail if the name contains the search string.
eg. HAMRICKMR&MRSLK
However it may bring the list down to a few manageable errors.

hth RES
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 to sort an Excel spreadsheet by more than 3 columns? William,Summit,Oh Excel Worksheet Functions 2 December 28th 05 04:31 PM
Sort order : Excel vs imported data John Excel Discussion (Misc queries) 0 December 9th 05 01:40 PM
How can I sort one column and have the entire row sort. (binding) Blue Excel Worksheet Functions 10 November 13th 05 07:09 PM
Question about sorting in protected worksheet SJC Excel Worksheet Functions 6 March 24th 05 10:35 PM
"-" ignored in sort Mike H Excel Discussion (Misc queries) 8 January 2nd 05 07:48 AM


All times are GMT +1. The time now is 03:13 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"