Search code examples
sortinggoogle-sheetsformula

how to sort a string contains list of number in google sheet?


I have this string value in google sheet - in cell A1 : "10,6,9,5" , what is the formula to sort the value of A1 to get this result -> "5,6,9,10" ?

I tried to use this formula :

=TEXTJOIN(",", TRUE, SORT(VALUE(SPLIT(A1, ","))))

but it's not working.


Solution

  • You may try:

    =join(",",sort(tocol(split(A1,","))))