Splitting Data in Cell

J

jonafire

I have a database that lists addresses in the following format:
111 Maple Dr.

I want to split the street number from the Street name so that I can
sort on the street name only. Is this possible?
 
B

Bob Umlas

helper column:
=MID(A1,FIND(" ",A1)+1,255)
fill down
sort on this column
Bob Umlas
Excel MVP
 
T

T. Valko

Maybe this:

A1 = 111 Maple Dr

B1 formula:

=MID(A1,FIND(" ",A1)+1,100)

Then sort on column B.
 
J

julsenson

Thanks Bob, That did the trick. Just for my enlightenment, can you
explain why it [=MID(A1,FIND(" ",A1)+1,255) ] is writtrn in that
format and how it works?
 
R

Rick Rothstein

The MID function returns substrings located in larger strings of text. The
first argument is the string of text you want to pull the substring out of;
the second argument is the position within the string of text you want to
start at when pulling out the substring and the third argument is the number
of characters making up your substring. The second argument in Bob's formula
uses the FIND function to locate the first blank space which is located
between your number and the street name (FIND returns the position number of
the character(s) you are trying to find)... the 1 is added to it because you
don't want to start pulling your substring out at the space, you want to do
that from the character after the space. The 255 that Bob used as his third
argument is just a number that is assumed to be bigger than the total number
of characters that could possibly make up a street name (that way, you get
all the text after the first space).

--
Rick (MVP - Excel)


Thanks Bob, That did the trick. Just for my enlightenment, can you
explain why it [=MID(A1,FIND(" ",A1)+1,255) ] is writtrn in that
format and how it works?

helper column:
=MID(A1,FIND(" ",A1)+1,255)
fill down
sort on this column
Bob Umlas
Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top