bpeltzer makes a valid point... let me expand on it a bit.
Text to columns along with Search & Replace are fantastic and work
great in for many situations, but there are also times when data you'd
like to manipulate doesn't necessarily fit into a generic model, or
have an ongoing need that would be best resolved by using an Excel
Function. Well, not to worry, Excel has many tricks up it's sleeve to
help you in almost every situation.
The tricks I speak of with regard to your question are what's known as
Text Functions. See below for a short list and general format.
LEFT - LEFT(text; num_chars)
MID - MID(text;start_num;num_chars)
RIGHT - RIGHT(text; num_chars)
SEARCH - SEARCH(find_text;within_text;start_num)
LEN - LEN(text)
Alrighty then, using some of Excel's powerful Text functions... lets go
get us some text shall we? Buckle up!
Examples:
Using your text "123 South Main St. Suite 6" and
Text is assumed to be in cell A1
Formula can be placed in any cell except A1
The following formula returns the first word or block of characters
from a string, which in this case is "123"
=LEFT(A1,FIND(" ",A1)-1)
The following formula returns all the characters in a cell preceding
the occurrence of "St", which in this case is "123 South Main St"
=LEFT(A1,FIND("St",A1)+1)
The following formula returns the last word or block of characters in a
string, which in this case is "6"
=RIGHT(A1,LEN(A1)-FIND("*",SUBSTITUTE(A1,"
","*",LEN(A1)-LEN(SUBSTITUTE(A1," ","")))))
The following formula searches for " Suite", trims the leading empty
space character, returning "Suite" and all the words or block of
characters that follow, which in this case is "Suite 6"
=RIGHT(A1,LEN(A1)-FIND(" Suite",SUBSTITUTE(A1,"
","*",LEN(A1)-LEN(SUBSTITUTE(A1," ","")))))
The following formula returns all but the first word or block of
characters in a string, which in this case is "South Main St. Suite 6"
=RIGHT(A1,LEN(A1)-FIND("*",SUBSTITUTE(A1,"
","*",LEN(A1)-LEN(SUBSTITUTE(A1," ","",1)))))
Hope you found this useful!
Danny Tedesco
http://www.wirelessphonecity.com
Cut the cables and let your data fly...