|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
G2单元格
=CUSTOM_TEXTJOIN_FILTER(",",$B$1:$B$22,$A$1:$A$22,E2,$C$1:$C$22,"正常")
- Function CUSTOM_TEXTJOIN_FILTER(delimiter As String, rng1 As Range, rng2 As Range, criteria1 As Variant, rng3 As Range, criteria2 As Variant) As String
- Dim result As String
- Dim i As Long
- For i = 1 To rng1.Rows.Count
- If rng2.Cells(i, 1).Value = criteria1 And rng3.Cells(i, 1).Value = criteria2 Then
- result = result & rng1.Cells(i, 1).Value & delimiter
- End If
- Next i
- If Len(result) > 0 Then
- result = Left(result, Len(result) - Len(delimiter))
- End If
- CUSTOM_TEXTJOIN_FILTER = result
- End Function
-
复制代码 |
|