Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9782

How to sort a split string

$
0
0

In google sheets I have this string:

salmon,fries,peas,coleslaw,onion,garlic,chicken,pancetta,creme fraiche,onion,garlic,chicken,pancetta,creme fraiche,onion,garlic,chicken,pancetta,creme fraiche,gf pizza,gf pizza,pepperoni pizza

I would like to split it by the , character, sort it and textjoin the result.

The overall function I'm working with is this:

=textjoin(",", true, sort(split(textjoin(",",true,$D$2:$D$22), ","), 1, true))

So it looks to me like the sort function call is not working, but obviously the input to it is not a range of cells but a list (?) of strings produced by splitting a combination of strings.

The inner-most textjoin is required because the cells being joined contain lists of strings separated by , characters. I am trying to sort every string from every cell in one large list.


Viewing all articles
Browse latest Browse all 9782

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>