SOLVED

How to sort numbers in a cell separated by a comma

%3CLINGO-SUB%20id%3D%22lingo-sub-2684489%22%20slang%3D%22en-US%22%3EHow%20to%20sort%20numbers%20in%20a%20cell%20separated%20by%20a%20comma%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2684489%22%20slang%3D%22en-US%22%3E%3CP%3EI%20need%20to%20sort%20numbers%20within%20a%20cell.%26nbsp%3B2018-09484%2C%202019-05944%2C%202016-03137%20to%202016-03137%2C%202018-09484%2C%202019-05944%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2684489%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2684531%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20sort%20numbers%20in%20a%20cell%20separated%20by%20a%20comma%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2684531%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1137495%22%20target%3D%22_blank%22%3E%40ch2221655%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-excel-formula%22%3E%3CCODE%3E%3DTEXTJOIN(%22%2C%20%22%2CTRUE%2CSORT(FILTERXML(%22%3CY%3E%3CZ%3E%22%26amp%3BSUBSTITUTE(A1%2C%22%2C%20%22%2C%22%3C%2FZ%3E%3CZ%3E%22)%26amp%3B%22%3C%2FZ%3E%3C%2FY%3E%22%2C%22%2F%2Fz%22)))%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2684615%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20sort%20numbers%20in%20a%20cell%20separated%20by%20a%20comma%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2684615%22%20slang%3D%22en-US%22%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1639%22%20target%3D%22_blank%22%3E%40Detlef%20Lewin%3C%2FA%3E%20Thank%20you!%3C%2FLINGO-BODY%3E
New 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 (New Contributor)
Solution

@ch2221655 

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