楼主 lrlxxqxa |
Q:如何将一个单元格内的证书与编号信息分成两列多行放置?
A:方法一 思路: 1、利用,和(的位置定位证书,利用(和)的位置定位编号; 2、在定位过程中利用substitute函数和find函数配合完成; 3、得到相应位置后,利用mid函数提取数据。
D3输入- =IF(ROW(A1)>(LEN(A$2)-LEN(SUBSTITUTE(A$2,",",)))+1,"",IF(ROW(A1)-1,MID(A$2,FIND("@",SUBSTITUTE(A$2,",","@",ROW(A1)-1))+1,FIND("@",SUBSTITUTE(A$2,"(","@",ROW(A1)))-FIND("@",SUBSTITUTE(A$2,",","@",ROW(A1)-1))-1),LEFT(A$2,FIND("@",SUBSTITUTE(A2,"(","@",1))-1)))
E3输入- =IF(D3="","",MID(A$2,FIND("@",SUBSTITUTE(A$2,"(","@",ROW(A1)))+1,FIND("@",SUBSTITUTE(A$2,")","@",ROW(A1)))-FIND("@",SUBSTITUTE(A$2,"(","@",ROW(A1)))-1))
下拉填充。
方法二(wjc2090742提供) 思路:将数据按固定分割符号“分列”提取,详细解析请参见 【公式解析系列】之数据按分隔符“分列”函数解法 http://www.exceltip.net/thread-2188-1-1.html
F3输入- =TRIM(MID(SUBSTITUTE(SUBSTITUTE($A$2&",","),",REPT(" ",99)),"(",REPT(" ",99)),(2*ROW(A1)-1-MOD(COLUMN(A1),2))*99+1,99))
右拖下拉填充
方法三(君柳提供) 思路:利用查找、替换、分列等基础操作完成 1、替换)为空; 2、替换,为Ctrl+Enter(换行符); 3、从编辑栏内复制数据,只保留文本进行粘贴; 4、利用数据→分列→间隔符号选择(进行数据分列; 5、选中第二列,保存为文本格式,确定。
操作过程如下:
该帖已经同步到 lrlxxqxa的微博 分离开证书及编号2.rar |
2楼 天南地北 |
D3可以简化- =IF(ROW(A1)>LEN(A$2)-LEN(SUBSTITUTE(A$2,"(",)),"",MID($A$2,FIND("@",SUBSTITUTE(","&$A$2,",","@",ROW(A1))),FIND("@",SUBSTITUTE($A$2,"(","@",ROW(A1)))-FIND("@",SUBSTITUTE(","&$A$2,",","@",ROW(A1)))))
|