发布网友 发布时间:2022-04-21 22:44
共4个回答
热心网友 时间:2023-08-19 10:04
只能给你一个建议,先把A1,B1中的数据按姓名(一般为三字吧)分割到A列,B列,然后就好操作了。热心网友 时间:2023-08-19 10:05
名子都是2个字的么?会不会出现张小三和李三这样子的?追问几十个人的名字追答
=LEFT(A1,FIND(B1,A1)-1)&(RIGHT(A1,LEN(A1)-LEN(B1)-FIND(B1,A1)))
试试吧(ps:先把b括号全部替换为空)
热心网友 时间:2023-08-19 10:05
建议使用vba的自定义函数。追答Function A1jB1(A1$, B1$)
Dim i&, Dic As Object, Arr, Tmp
Set Dic = CreateObject("Scripting.Dictionary")
A1 = Replace(A1, ",", ",")
Arr = Split(A1 & ",", ",")
For i = 0 To UBound(Arr)
Dic(Arr(i)) = ""
Next i
B1 = Replace(B1 & ",", ",", ",")
Arr = Split(B1, ",")
For i = 0 To UBound(Arr)
Dic(Arr(i)) = "": Dic.Remove Arr(i)
Next i
Arr = Dic.keys
If Dic.Count > 0 Then Tmp = Arr(0) Else Tmp = ""
For i = 1 To UBound(Arr)
Tmp = Tmp & "," & Arr(i)
Next i
Set Dic = Nothing
A1jB1 = Tmp
End Function
代码如上,然后单元格输入=A1jB1(A1,B1)
热心网友 时间:2023-08-19 10:06
用函数追答你意思 C1结果为 A1和B1的相同数据?
你说的
B1中包含(李四,王二)
,是什么意思?
最好上个截图,说明下