Assume the zip codes populate cells A1:A100.
Use a helper column, say column B. In B1 enter the formula
=len(A1)
and copy down to B100. Then sort A1:B100 by Column B and then Column A.
I would use a helper column with a formula like this
=IF(ISNUMBER(A1),TEXT(A1,"00000"),A1)
Then sort on this column. That will generate this order
10021
10021-0123
10022
10022-0123
etc.
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.