ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   Tell users how to sort 5 digit and 9 digit zipcodes correctly aft. (https://www.excelbanter.com/new-users-excel/13762-tell-users-how-sort-5-digit-9-digit-zipcodes-correctly-aft.html)

[email protected]

Tell users how to sort 5 digit and 9 digit zipcodes correctly aft.
 
After applying special format to column to accommodate 5 and 9 digit
zipcodes, I was not able to sort by zipcode correctly. I added leading zeros
to 4 digit zipcodes to make them 5 digit. My 5 digit zip codes appear before
my 9 digit zip codes when I sort by ascending order.

CLR

Concatenate -0000 into your 5 diget numbers in a hellper column, with

=IF(LEN(A1)5,A1,A1&"-0000") then Copy Pastespecial Values
this will give 11111-0000 for a 5 diget code of 11111.............

then select both columns and sort on the new one.........then delete the new
column if desired........

Vaya con Dios,
Chuck, CABGx3


"
om wrote in message
...
After applying special format to column to accommodate 5 and 9 digit
zipcodes, I was not able to sort by zipcode correctly. I added leading

zeros
to 4 digit zipcodes to make them 5 digit. My 5 digit zip codes appear

before
my 9 digit zip codes when I sort by ascending order.





All times are GMT +1. The time now is 12:45 PM.

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