How do I sort postal addresses by street name, then number

M

Mel

The street address column has street number and name together. (28
Maple Ave.) How do I sort by street name, then by number?

thanks for any help
 
C

CurlyDave

Yes the best way would be to separate the first part of the string
You could use text to columns Data=>text to columns
Or use this
=RIGHT(A1,LEN(A1)-SEARCH(" ",A1))
This will display anything after the first space in the string
Then you can sort
 
R

Roger Govier

Hi Mel

I would add another column at the right of existing data.
Assuming your address is in column A, enter in the new column
=MID(A2,FIND(" ",A2)+1)&" "&TEXT(LEFT(A2,FIND(" ",A2)-1),"0000")

This will reverse the data
Maple Avenue 0028
Then Mark your whole block of data but sort on the new Column
You will then Have the data sorted by Street, and by number within Street
(as long as numbers are less than 9999)
 
R

Roger Govier

Apologies Mel
I left out part of the mid function.
That should have read
=MID(A2,FIND(" ",A2)+1,99)&" "&TEXT(LEFT(A2,FIND(" ",A2)-1),"0000")
 
M

Mel

Thanks, it worked well.

Apologies Mel
I left out part of the mid function.
That should have read
=MID(A2,FIND(" ",A2)+1,99)&" "&TEXT(LEFT(A2,FIND(" ",A2)-1),"0000")
Thanks much. It worked well.
 

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