=contxt(",",IF(MMULT({1,1},SIGN(IFERROR(FIND(TRANSPOSE(","&ROW(2:12)&","),","&A1:A2&","),0)))=2,TRANSPOSE(ROW(2:12)),"")) 数组公式,老感觉这个公式搞复杂了,不过有点短路,想不出来怎么改,先这样吧 不过反正都要用到宏,还不如针对你的情况写一个,只是我用这个自定义函数习惯了,懒的去写了。 楼上回复说的那个自定义函数 Function ConTxt(fgf, ParamArray args() As Variant) As Variant Dim tmptext As Variant, i As Variant, cellv As Variant Dim cell As Range tmptext = "" For i = 0 To UBound(args) If Not IsMissing(args(i)) Then Select Case TypeName(args(i)) Case "Range" For Each cell In args(i) If cell <> "" Then tmptext = tmptext & cell & fgf Next cell Case "Variant()" For Each cellv In args(i) If cellv <> "" Then tmptext = tmptext & cellv & fgf Next cellv Case Else If args(i) <> "" Then tmptext = tmptext & args(i) & fgf End Select End If Next i tmptext = Left(tmptext, Len(tmptext) - Len(fgf)) ConTxt = tmptext End Function