ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How do you sort zip codes with 0's being the lead number? (https://www.excelbanter.com/excel-discussion-misc-queries/38508-how-do-you-sort-zip-codes-0s-being-lead-number.html)

Pat Hughes

How do you sort zip codes with 0's being the lead number?
 
How do you sort zip codes where some of them start with 0? I have changed
the format to text, number, general with no luck. I would like to be able to
do this without having to put a ' in front of the number.

Richard Neville

The secret is to find the special format for zip codes and format them all
that way. Select the cells with zips and delete all the ' marks, and - marks
if any, using the Replace function. Then go to Format-Cells. Click on the
Number tab and select Special. There is one format for 5-digit zips and
another for 9-digit (which automatically inserts the hyphen). If you enter a
zip beginning with a zero, the leading zero will show. They will sort from
00001 to 99999, but you will find you cannot mix 5- and 9-digit zips--use
one or the other but not both.

"Pat Hughes" <Pat wrote in message
...
How do you sort zip codes where some of them start with 0? I have changed
the format to text, number, general with no luck. I would like to be able
to
do this without having to put a ' in front of the number.




Pat Hughes

Thanks for your quick reply. I'm sorry. I used zip codes as a way to avoid
writing so much out. But I have a column of numbers that some start with 0
and some with 00 and some with the number like 234. I need to sort these
where the 0's are in the right order in the beginning of the column.

Pat

"Richard Neville" wrote:

The secret is to find the special format for zip codes and format them all
that way. Select the cells with zips and delete all the ' marks, and - marks
if any, using the Replace function. Then go to Format-Cells. Click on the
Number tab and select Special. There is one format for 5-digit zips and
another for 9-digit (which automatically inserts the hyphen). If you enter a
zip beginning with a zero, the leading zero will show. They will sort from
00001 to 99999, but you will find you cannot mix 5- and 9-digit zips--use
one or the other but not both.

"Pat Hughes" <Pat wrote in message
...
How do you sort zip codes where some of them start with 0? I have changed
the format to text, number, general with no luck. I would like to be able
to
do this without having to put a ' in front of the number.






All times are GMT +1. The time now is 03:47 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com