Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

After importing data to numbers columns not sorting properly

After importing data from excel the new data (addresses) is showing in capitalized letters. When I sort the columns they will not sort in order, the caps will be way down the list instead of below or above the same address that is not i caps. Even after changing column so that that only first letter is in caps, it won't sort properly. I have formatted the column to be "text". It is a file with over 7,000 addresses so this cannot be done manually.

MacBook Pro

Posted on Nov 14, 2018 6:33 PM

Reply
Question marked as Best reply

Posted on Nov 16, 2018 3:38 PM

In your sample document, create a new column to the right (column E), select the entire column and change the format of the cells to Automatic (they started out as Text when I did it). Put the formula in cell E1. Select cell E1 and Copy (cmd C), select the entire column, and Paste (cmd V) to fill the entire column with the formula. After that, select the entire column again, Copy, select column D, then use Paste Formula Results from the Edit menu to overwrite the existing text with your new text. Finally, you can delete column E.


(Paste Values, which is what I called it in my earlier post, is the Excel name for Paste Formula Results. Forget I said it)


User uploaded file

Similar questions

6 replies
Question marked as Best reply

Nov 16, 2018 3:38 PM in response to Charlotte2012

In your sample document, create a new column to the right (column E), select the entire column and change the format of the cells to Automatic (they started out as Text when I did it). Put the formula in cell E1. Select cell E1 and Copy (cmd C), select the entire column, and Paste (cmd V) to fill the entire column with the formula. After that, select the entire column again, Copy, select column D, then use Paste Formula Results from the Edit menu to overwrite the existing text with your new text. Finally, you can delete column E.


(Paste Values, which is what I called it in my earlier post, is the Excel name for Paste Formula Results. Forget I said it)


User uploaded file

Nov 14, 2018 8:06 PM in response to Charlotte2012

Caps are the same as not when sorting so I am thinking something else must be going on. Offhand I cannot think of a reason for imported text to become capitalized when it was not before, so it is already strange. It might be helpful if you make a new document, copy some of the data to it (and ensure it has the same problem in the new document), then post that document somewhere for us to examine (Dropbox, share on iCloud, etc). Or you might add a temporary new column and try a formula like =CODE(A), where column A has the addresses that are not sorting correctly. This will give you the ASCII code of the first character of the strings, which is the main character it is sorting on. Compare two addresses that should be sorted next to each other and see if it provides any clues.


Where did this document originate? Was it on the web, was it a document you created in Excel, Windows or Mac version of Excel, is it really a CSV (comma separated value) file or tab separated file,, etc.? Problems are more likely with files from the web, they may not be encoded strictly to the Excel spec Numbers is expecting.

Nov 15, 2018 6:09 PM in response to Badunit

Thank you so much for sharing your expertise. The list I imported was capitalized when I imported it, the existing list I have is not. The imported data stayed capitalized, so when I sort now in the mix with the old existing data, the imported data is not sorting with the old data. Even after I change the whole column to not capitalized, the new data still will not sort. I have to manually delete the text and rewrite it in order for it to start sorting with the old data. The imported list was from an excel file. How may I send you a small version of my doc ? thank you

Nov 16, 2018 9:33 AM in response to Charlotte2012

I received your file. The problematic city names all have a leading space. Space characters are lower in value than alphanumerics and will sort to the top in an ascending sort.


First thing: back up your file in case something messes up. After that, create a new column and in that column use the formula =TRIM(D) to get rid of all extraneous spaces in the city names (column D being the column of city names). Copy the entire column then Paste Values into column D, overwriting the city names that were there. After that you can get rid of the new column.


The addresses in column C start with numbers and the numbers seem to be sorting correctly. They sort like text when they are part of text or in cells formatted as text. So you will get a sort order like 1, 10, 101, 11, 2, 3,...


If your actual table has street names without the street numbers and it is not sorting properly, I suspect it, too, has leading spaces that should be removed. Use the same method as given above for the city names.

After importing data to numbers columns not sorting properly

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.