Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
 
Posts: n/a
Default Excel doesn't sort zip codes properly

I have a sizable worksheet (6,000 rows by 10 columns), which includes
names, addresses, and zip codes. When I try to sort on zip codes, the
worksheet sorts in two sections vertically, in ascending order. I
believe that is because some of the zip codes are formatted as values
and others are formatted as text. Even so, I have tried to format the
zip code column as text and it has not helped. So I'm wondering what I
need to change in the zip code cell formatting to make the proper sort
possible. Many thanks for suggestions.

  #2   Report Post  
Jason Morin
 
Posts: n/a
Default

Use this in a new column to convert all zip codes to
text, and then sort on this new column:

=TEXT(IF(ISERROR(FIND("-",A1)),A1&"-0000",A1),"00000-
0000")

If the zip codes are all 5 digits (ie not in ZIP+4
format), use:

=TEXT(A1,"00000")

HTH
Jason
Atlanta, GA


-----Original Message-----
I have a sizable worksheet (6,000 rows by 10 columns),

which includes
names, addresses, and zip codes. When I try to sort on

zip codes, the
worksheet sorts in two sections vertically, in ascending

order. I
believe that is because some of the zip codes are

formatted as values
and others are formatted as text. Even so, I have tried

to format the
zip code column as text and it has not helped. So I'm

wondering what I
need to change in the zip code cell formatting to make

the proper sort
possible. Many thanks for suggestions.

.

  #3   Report Post  
 
Posts: n/a
Default

Brilliant and most helpful suggestion. The zip codes were all 5 digit,
so I use your option #2, then converted to values using Copy & Paste
Special. The sort now works fine. Many thanks.


Jason Morin wrote:
Use this in a new column to convert all zip codes to
text, and then sort on this new column:

=TEXT(IF(ISERROR(FIND("-",A1)),A1&"-0000",A1),"00000-
0000")

If the zip codes are all 5 digits (ie not in ZIP+4
format), use:

=TEXT(A1,"00000")

HTH
Jason
Atlanta, GA


-----Original Message-----
I have a sizable worksheet (6,000 rows by 10 columns),

which includes
names, addresses, and zip codes. When I try to sort on

zip codes, the
worksheet sorts in two sections vertically, in ascending

order. I
believe that is because some of the zip codes are

formatted as values
and others are formatted as text. Even so, I have tried

to format the
zip code column as text and it has not helped. So I'm

wondering what I
need to change in the zip code cell formatting to make

the proper sort
possible. Many thanks for suggestions.

.


  #4   Report Post  
Micah Chaney
 
Posts: n/a
Default

I think you'd want to sort on number wouldn't you? Delete the column header,
highlight the entire column change the value to Number, then rename the
column header to Zip or whatever. I think that should work.

" wrote:

I have a sizable worksheet (6,000 rows by 10 columns), which includes
names, addresses, and zip codes. When I try to sort on zip codes, the
worksheet sorts in two sections vertically, in ascending order. I
believe that is because some of the zip codes are formatted as values
and others are formatted as text. Even so, I have tried to format the
zip code column as text and it has not helped. So I'm wondering what I
need to change in the zip code cell formatting to make the proper sort
possible. Many thanks for suggestions.


  #5   Report Post  
 
Posts: n/a
Default

Thanks, Micah. I followed Jason's suggestion and the sort works
perfectly now.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003 FAILS, but Excel 2000 SUCCEEDS ??? Richard Excel Discussion (Misc queries) 2 May 13th 23 11:46 AM
Excel Sort function should not sort the cell formatting! Lisa D.N.1 Excel Worksheet Functions 1 December 28th 04 08:37 PM
Excel 2000 running on Windows XP SP2 does not properly open CSV fi Oscar Excel Discussion (Misc queries) 1 December 20th 04 10:10 PM
Word field codes in Excel data file Includetext mranz Excel Discussion (Misc queries) 1 December 7th 04 11:19 PM
Excel Auto Filter: WHY'S SORT @ TOP OF LIST? WHEN I KEY TO "SHOW . Dan W Excel Worksheet Functions 0 December 1st 04 03:53 PM


All times are GMT +1. The time now is 04:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"