答案 0 :(得分:4)
在Excel中:
=TEXTJOIN(",",TRUE,IF(ISNUMBER(SEARCH($A$8:$A$11,A1)),$A$8:$A$11,""))
作为数组公式。退出编辑模式时,需要使用Ctrl-Shift-Enter而不是Enter确认。
如果您无权访问Excel中的TEXTJOIN(),请将其放入模块中并使用上述公式。
Function TEXTJOIN(delim As String, skipblank As Boolean, arr)
Dim d As Long
Dim c As Long
Dim arr2()
Dim t As Long, y As Long
t = -1
y = -1
If TypeName(arr) = "Range" Then
arr2 = arr.Value
Else
arr2 = arr
End If
On Error Resume Next
t = UBound(arr2, 2)
y = UBound(arr2, 1)
On Error GoTo 0
If t >= 0 And y >= 0 Then
For c = LBound(arr2, 1) To UBound(arr2, 1)
For d = LBound(arr2, 1) To UBound(arr2, 2)
If arr2(c, d) <> "" Or Not skipblank Then
TEXTJOIN = TEXTJOIN & arr2(c, d) & delim
End If
Next d
Next c
Else
For c = LBound(arr2) To UBound(arr2)
If arr2(c) <> "" Or Not skipblank Then
TEXTJOIN = TEXTJOIN & arr2(c) & delim
End If
Next c
End If
TEXTJOIN = Left(TEXTJOIN, Len(TEXTJOIN) - Len(delim))
End Function
在Google表格中:
=Join(",",filter($A$8:$A$11,ISNUMBER(SEARCH($A$8:$A$11,A1))))
答案 1 :(得分:0)
我尝试将此添加为评论,但我还没有声誉! 无论如何,我想我找到了你正在寻找的东西。在您的示例中,您需要类似
的内容 =IF(ISERROR(SEARCH("*startup*",A1,1)),"","startup, ")
并将其放入输出单元格。
编辑:我在发布之后看到斯科特在3分钟内击败了我。然而,它们的方式略有不同,所以我也会把它放在一边。