用函数是可以的,不过本人想到的方法会麻烦复杂许多。
如果楼主确实要做而又没有其他更好的办法,可以试下本人以下比效麻烦复杂些的方法:
1、在B表A列前插入一列(原A─J列将往后顺延一列)后,在A1输入“=CONCATENATE(B2,IF(COUNTIF(B$2:B2,B2)<10,CONCATENATE("1000",COUNTIF(B$2:B2,B2)),IF(COUNTIF(B$2:B2,B2)<100,CONCATENATE("100",COUNTIF(B$2:B2,B2)),IF(COUNTIF(B$2:B2,B2)<1000,CONCATENATE("10",COUNTIF(B$2:B2,B2)),IF(COUNTIF(B$2:B2,B2)<10000,CONCATENATE("1",COUNTIF(B$2:B2,B2)),CONCATENATE("",COUNTIF(B$2:B2,B2)))))))”,然后往下拖,(20000行以内适宜)
2、在A表中
A5=IF(ROW()-4<=COUNTIF(B表!B$2:B$10000,B$2),B$2,"")
B5=IF(A5="","",VLOOKUP(IF(ROW()-4<10,CONCATENATE(A5,"1000",ROW()-4),IF(ROW()-4<100,CONCATENATE(A5,"100",ROW()-4),IF(ROW()-4<1000,CONCATENATE(A5,"10",ROW()-4),IF(ROW()-4<10000,CONCATENATE(A5,"1",ROW()-4),CONCATENATE(A5,ROW()-4))))),B表!$A$2K$20000,3,FALSE))
C5=IF(A5="","",VLOOKUP(IF(ROW()-4<10,CONCATENATE(A5,"1000",ROW()-4),IF(ROW()-4<100,CONCATENATE(A5,"100",ROW()-4),IF(ROW()-4<1000,CONCATENATE(A5,"10",ROW()-4),IF(ROW()-4<10000,CONCATENATE(A5,"1",ROW()-4),CONCATENATE(A5,ROW()-4))))),B表!$A$2K$20000,4,FALSE))
D5=IF(A5="","",VLOOKUP(IF(ROW()-4<10,CONCATENATE(A5,"1000",ROW()-4),IF(ROW()-4<100,CONCATENATE(A5,"100",ROW()-4),IF(ROW()-4<1000,CONCATENATE(A5,"10",ROW()-4),IF(ROW()-4<10000,CONCATENATE(A5,"1",ROW()-4),CONCATENATE(A5,ROW()-4))))),B表!$A$2K$20000,5,FALSE))
…………
然后各列依次往下拖,(拖多少行看自己需要,一般20000行以内适宜)
以上函数楼主如觉得合适,麻烦回复打个招呼,给些意见。谢谢!
[此贴子已经被作者于2006-10-18 22:09:10编辑过]
|