将数字串中的数字去重并有序相连

例题描述和简单分析

Excel文件Book1.xlsx,数据如下所示:


A B
1 Number Result
2 127425
3 2784425
4 121
5 22222
6 9271

A列是数字串,要求对每位数字去重排序,写入B列,结果如下: 


A B
1 Number Result
2 127425 12457
3 2784425 24578
4 121 12
5 22222 2
6 9271 1279

解法及简要说明

Excel中加载插件ExcelRaq.xll后。

选中B2格,输入公式:=esproc("=string(int(?1)).split().id().concat()",A2),下拉扩展至B6,即可实现需求。

问答搜集

https://stackoverflow.com/questions/63540928/divide-numbers-into-unique-sorted-digits-displayed-in-a-label-on-a-userform