Quora 016: How do I sort a hyphen delimited string of numbers, and return the sorted string?

preview_player
Показать описание
This is a video response to a quora question simlar to the title. "How do I sort numbers with dashes inside a cell on Excel in sequential order from 58-02-48-25-37-13 to 02-13-25–37–48–58 using formulas or VBA codes?"

I have solved this problem using Excel functions, and then built a lambda function that performs this task with a single function call.

=LAMBDA(inputText,
LET(
splitApartText, TEXTSPLIT(inputText, "-")*1,
sortedText, SORT(splitApartText, , 1, TRUE),
output, TEXTJOIN("-", , sortedText),
output
)
)
Рекомендации по теме
visit shbcf.ru