Sort AlphaNumeric with structured references in Excel

限于喜欢 提交于 2019-11-28 14:32:33

Copy the data into a new column say B If you are using excel 2007 or higher, go to data tab --> text to columns option after selecting your data in B

Here you can choose delimited and it will separate your data into 2 columns. Then apply the sorting based on this column

In an unused column to the right, use this formula starting in row 2,

=LEFT(A2, 2)&TEXT(--MID(A2, 3, FIND(".", A2&".")-3), "000;@")&TEXT(--MID(A2, FIND(".", A2&".")+1, 99), "000;@")

Fill down as necessary then sort conventionally using the helper column as the primary sort key.

        

If you put a 0 prior to the numbers, that would take care of it.

X=01.1

Or, in a convoluted way, split the column as recommended above, sort the way you want and then reassemble. I would also create a column with the right 1-n sequence, just in case I need to sort in a particular way, but the come back to the original sort.

The Solution to the Problem is:

=LEFT(IF(ISNUMBER(SEARCH(";";A1));LEFT(A1;FIND(";";A1;1)-1);A1);2)&TEXT(--MID(IF(ISNUMBER(SEARCH(";";A1));LEFT(A1;FIND(";";A1;1)-1);A1);3;FIND(".";IF(ISNUMBER(SEARCH(";";A1));LEFT(A1;FIND(";";A1;1)-1);A1)&".")-3);"000;@") &TEXT(--MID(IF(ISNUMBER(SEARCH(";";A1));LEFT(A1;FIND(";";A1;1)-1);A1);FIND(".";IF(ISNUMBER(SEARCH(";";A1));LEFT(A1;FIND(";";A1;1)-1);A1)&".")+1;99);"000;@")
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!