ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Letters and 000s in front of actual number not sorting correctly (https://www.excelbanter.com/excel-discussion-misc-queries/58180-letters-000s-front-actual-number-not-sorting-correctly.html)

darkjedi

Letters and 000s in front of actual number not sorting correctly
 

When sorting numbers in excell with letter in front and then zeros, I
don't get the expected results. The Macintosh OSX finder views the
numbers correctly, but I can't seem to get the same results in excel.
Can this even be done in excel?

Excell sort
CA0002
CA00020
CA0021
CA02
CA021
CA02C
CA2

Needs to be
CA0002
CA02
CA02C
CA2
CA00020
CA0021
CA021


--
darkjedi
------------------------------------------------------------------------
darkjedi's Profile: http://www.excelforum.com/member.php...o&userid=29153
View this thread: http://www.excelforum.com/showthread...hreadid=489794


Dave Peterson

Letters and 000s in front of actual number not sorting correctly
 
I would think the best way would be to separate the component parts into
separate cells.

CA 2 C

With that numeric column treated as numbers.

Then select the whole range and sort by that middle helper column, then first
helper column, then last helper column.

But this kind of sort would keep:
CA0002
CA002
CA02
CA2

in the same order as the original data.

I'm not sure what the rules are when you have the numeric portion all the
same--maybe a fourth helper column based on the length???



darkjedi wrote:

When sorting numbers in excell with letter in front and then zeros, I
don't get the expected results. The Macintosh OSX finder views the
numbers correctly, but I can't seem to get the same results in excel.
Can this even be done in excel?

Excell sort
CA0002
CA00020
CA0021
CA02
CA021
CA02C
CA2

Needs to be
CA0002
CA02
CA02C
CA2
CA00020
CA0021
CA021

--
darkjedi
------------------------------------------------------------------------
darkjedi's Profile: http://www.excelforum.com/member.php...o&userid=29153
View this thread: http://www.excelforum.com/showthread...hreadid=489794


--

Dave Peterson


All times are GMT +1. The time now is 02:55 AM.

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