简体   繁体   English

Excel 公式在单个单元格中对分隔数字进行排序

[英]Excel formula in sorting delimited numbers in a single cell

Im new in excel formulas.我是 excel 公式的新手。 I need an excel formula that can sort delimited numbers in a single cell.我需要一个 excel 公式,它可以对单个单元格中的分隔数字进行排序。 Note: I have different lengths of values per cell.注意:每个单元格的值长度不同。

Ig 349|2|4|11|1|2 ig 349|2|4|11|1|2

Outcome: 1|2|2|4|11|349结果:1|2|2|4|11|349

Im thinking of reverse concatenating it first then sort it then concatenate it again.我想先反向连接它,然后对其进行排序,然后再次连接它。 But i can't figure it out how to make a working formula for that.但我无法弄清楚如何为此制定一个有效的公式。 Hope someone can help me.希望可以有人帮帮我。 Thanks.谢谢。

This formula solution worked in cell contains numeric value only.在单元格中工作的此公式解决方案仅包含数值。

The formula using Textjoin and Filterxml function of which Textjoin available in Office 365 and Excel 2019, and Filterxml available in Excel 2013 and later Excel version The formula using Textjoin and Filterxml function of which Textjoin available in Office 365 and Excel 2019, and Filterxml available in Excel 2013 and later Excel version

Assume your data housed in A1假设您的数据存放在A1

In B1 , enter array formula (Confirm by pressing Shift + Ctrl + Enter):B1中,输入数组公式(按 Shift + Ctrl + Enter 确认):

=TEXTJOIN("|",1,IFERROR(1/(1/SMALL(FILTERXML("<a><b>"&SUBSTITUTE(A1,"|","</b><b>")&"</b></a>","//b"),ROW($1:$99))),""))

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM