View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.newusers
Ragdyer
 
Posts: n/a
Default Zip Code Formatting

You could use 2 'helper ' columns.

You could do this 2 ways.
If you're going to do this often, in an on-going basis, use the Text
formulas, where you can save the 2 columns of formulas, and paste your new
data in the "separate me" column.

If it's a one shot deal use TTC (Text To Columns), which takes some setting
up each time.

1 ] Text formulas:

"Separate Me" column is ColumnA.

In B1 enter,
=LEFT(A1,5)

In C1 enter,
=(LEN(A1)5)*RIGHT(A1,4)

Select *both* B1 and C1 and drag down to copy as needed.

Then, select A1 to Cn,and then sort by Column B, then by Column C.

You should now have your data sorted as desired.
Use or copy Column A as needed.

You can clear ColumnA or simply overwrite it the next time you have data to
import and sort.

2 ] TTC

Select the column of data and make sure you have 2 empty adjoining columns,
then:
<Data <Text To Columns <Fixed Width <Next,
Click in the "Preview Window" and place the 'Break line" *after* the dash,
*before* the last 4 numbers.
Then <Next
In the Preview Window the first column is selected by default, so just click
on "Text" under "Column Data Format".
Click in the second column to select it, and also change this to "Text".
Then click in the Destination Box and change the default address (original
data location) to the fist cell of the next empty adjoining column.
This preserves the original data from being overwritten.
Then <Finish

Now, select all 3 columns and sort on the second, then the third column.
Your original data is now sorted as you wish.

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------

"JWCrosby" wrote in message
...
That will just delete the "plus four" side of those zipcodes, but I don't
want that. I want to retain the zipcodes as they are, but be able to sort
them all in proper zipcode order. So it might look like this:
01804
01804-1234
11456
12345
12345-2245

etc.

'nuther idea?

Jerry

"Bearacade" wrote:


Assuming your data is in column A, In another column (say B) put this
in.

=LEFT(A1,5)

Now drag and fill as far as your data go..


--
Bearacade


------------------------------------------------------------------------
Bearacade's Profile:
http://www.excelforum.com/member.php...o&userid=35016
View this thread:
http://www.excelforum.com/showthread...hreadid=557123