Sort AlphaNumeric with structured references in Excel

依然范特西╮ 提交于 2019-12-17 21:12:45

问题


I Have an Excel Sheet with data that looks like that.

Data
x=1.1
x=11.2
x=10.3
x=1.4
x=2.5;2.6
x=2.1
x=4.7
x=6.8
x=6.2;6.3
x=1.10

What i want to do is, to sort the List that it Looks like that.

DataSort
x=1.1
x=1.4
x=1.10
x=2.1
x=2.5;2.6
x=4.7
x=6.2;6.3
x=6.8
x=10.3
x=11.2

I tried to do that with that Formula

=LEFT(Tabelle1[[#this row];[Data]];2) & TEXT(SUBSTITUTE(Tabelle1[[#this row];[Data]];LEFT(Tabelle1[[#this row];[Data]];2);"");"#0.0#")

But that did not work. Can someone give me a hint to the right Direction?


回答1:


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




回答2:


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.

        




回答3:


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.




回答4:


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;@")


来源:https://stackoverflow.com/questions/31403961/sort-alphanumeric-with-structured-references-in-excel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!