SOLVED

How to sort numbers in a cell separated by a comma

Copper Contributor

I need to sort numbers within a cell. 2018-09484, 2019-05944, 2016-03137 to 2016-03137, 2018-09484, 2019-05944

2 Replies
best response confirmed by ch2221655 (Copper Contributor)
Solution

@ch2221655 

=TEXTJOIN(", ",TRUE,SORT(FILTERXML("<y><z>"&SUBSTITUTE(A1,", ","</z><z>")&"</z></y>","//z")))
1 best response

Accepted Solutions
best response confirmed by ch2221655 (Copper Contributor)
Solution

@ch2221655 

=TEXTJOIN(", ",TRUE,SORT(FILTERXML("<y><z>"&SUBSTITUTE(A1,", ","</z><z>")&"</z></y>","//z")))

View solution in original post