请问各位大佬,在EXCEL中同一行有多个词,搜索关键词数量怎么弄
excel吧
全部回复
仅看楼主
level 3
Higher_F 楼主
2023年03月13日 14点03分 1
level 3
Higher_F 楼主
用COUNTIF函数,1排有一个,他就显示数量1,1排有3个,他还是显示数量1
2023年03月13日 14点03分 2
level 3
Higher_F 楼主
各位大佬,帮下忙,好人一生平安!
2023年03月13日 14点03分 3
level 11
Option Explicit
Sub abc()
 Dim a(2), i, j, t, sum
 For i = 1 To 2
  a(i) = Cells(1, i).Resize(Cells(1, i).End(xlDown).Row).Value
 Next
 For i = 1 To UBound(a(2))
  For j = 1 To UBound(a(1))
   t = a(1)(j, 1)
   t = Replace(t, a(2)(i, 1), vbNullString)
   sum = sum + (Len(a(1)(j, 1)) - Len(t)) / Len(a(2)(i, 1))
  Next
  a(2)(i, 1) = sum: sum = 0
 Next
 [c1].Resize(UBound(a(2))) = a(2)
End Sub
2023年03月14日 01点03分 4
感谢
2023年03月15日 10点03分
level 11
Option Explicit
Sub abc()
 Dim a(2), i, j, t, sum
 For i = 1 To 2
  a(i) = Cells(1, i).Resize(Cells(1, i).End(xlDown).Row).Value
 Next
 For i = 1 To UBound(a(2))
  For j = 1 To UBound(a(1))
   t = a(1)(j, 1)
   t = Replace(t, a(2)(i, 1), vbNullString)
   sum = sum + (Len(a(1)(j, 1)) - Len(t)) / Len(a(2)(i, 1))
  Next
  a(2)(i, 1) = sum: sum = 0
 Next
 [c1].Resize(UBound(a(2))) = a(2)
End Sub
2023年03月14日 01点03分 5
好像又给吃掉了,源数据从[a1]开始。
2023年03月14日 01点03分
@🌴菠萝蜜🌴 好复杂,函数咋学,有啥窍门没有
2023年03月14日 01点03分
level 11
2023年03月14日 01点03分 6
level 13
东鹏特饮的6是怎么来的
2023年03月14日 01点03分 7
level 7
2023年03月14日 01点03分 8
level 11
'这个估计要精确匹配
Option Explicit
Sub abc()
 Dim a(2), i, j, k, t, sum
 For i = 1 To 2
  a(i) = Cells(1, i).Resize(Cells(1, i).End(xlDown).Row).Value
 Next
 For i = 1 To UBound(a(2))
  For j = 1 To UBound(a(1))
   t = Split(a(1)(j, 1), ",") '大逗号
   For k = 0 To UBound(t)
    If a(2)(i, 1) = t(k) Then sum = sum + 1
   Next
  Next
  a(2)(i, 1) = sum: sum = 0
 Next
 [c1].Resize(UBound(a(2))) = a(2)
End Sub
2023年03月14日 03点03分 9
level 13
2023年03月15日 12点03分 10
1