Home > OS >  In Excel, how can I sort by the first value when there are multiple values in the cell?
In Excel, how can I sort by the first value when there are multiple values in the cell?

Time:01-25

I have an automatically generated spreadsheet in Excel. The values of one column are:

1, 184
10, 18, 90
102, 207
11, 13
2
20, 50
204
3, 120

(all comma separated values in a single column, as below)

enter image description here

What I need to do is sort by the first number, so that the above would be:

1, 184
2
3, 120
10, 18, 90
11, 13
20, 50
102, 207
204

How can i do this in Excel?

CodePudding user response:

Excel 365 current channel:

=SORTBY(A1:A8, NUMBERVALUE(TEXTBEFORE(A1:A8,",",,,,A1:A8)))
  • Related