如何在Excel中对分隔的列进行排序?

huangapple go评论141阅读模式
英文:

How can I sort columns in EXCEL that are separated?

问题

我需要对一个Excel文件中的多个分开的列进行排序。对于相邻的列,没有问题,因为它选择了范围(例如,如果您想根据操作次数对客户进行排序,可以选择从列A到列C)。但是,当我想根据名义价值对客户进行排序时,当选择范围A:D时,它还会选择列C,而现在我不再需要它。因此,我需要一个可以对我感兴趣的列进行排序而不包括所有列的公式。

我已经在第一个(简单)示例中使用了这个公式:=SORT(A2:C12;3;-1;FALSE)

但当我尝试对列A、B和D进行排序时,会出现以下情况(我不希望列C出现)。

我尝试避免或删除不感兴趣的列,但没有效果。

英文:

I need to sort multiple columns of an excel file that are separate. For columns that are next to each other, there is no problem because it is selecting the range (as an example of column A to C if you wanted to order the customers based on the number of operations). At the moment in which I want to order the clients according to their nominal value, when selecting the range A:D, it also selects column C, which now no longer interests me. So I need a formula that sorts the columns I'm interested in and doesn't include all of them.

I have been using this formula for the first (easy) example: =SORT(A2:C12;3;-1;FALSE)

如何在Excel中对分隔的列进行排序?

But when I try to sort the columns A, B and D, happens the following (and I dont the column C to appear):

如何在Excel中对分隔的列进行排序?

I have tried to avoid or deleting the columns which don´t interest me, but doesn´t work

答案1

得分: 1

=SORT(CHOOSECOLS(A2:E12,1,2,4),3,-1)

或者如果您想要更加动态化:

=LET(cols,   {1,2,4},
     d,      FILTER(CHOOSECOLS(A:E,cols),A:A<>""), 
     header, TAKE(d,1),
     data,   DROP(d,1),
VSTACK(header,SORT(data,3,-1)))
英文:

You can use CHOOSECOLS to make the selection of the columns you need and sort these:

=SORT(CHOOSECOLS(A2:E12,1,2,4),3,-1)

Or if you want it to be more dynamical:

=LET(cols,   {1,2,4},
     d,      FILTER(CHOOSECOLS(A:E,cols),A:A&lt;&gt;&quot;&quot;),
     header, TAKE(d,1),
     data,   DROP(d,1),
VSTACK(header,SORT(data,3,-1)))

huangapple
  • 本文由 发表于 2023年3月8日 16:47:22
  • 转载请务必保留本文链接:https://go.coder-hub.com/75670947.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定