Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- False Negative
- False Negative, False Positive
- False Negative
- False Positive
- Positive
- False Negative 2
- False Positive 1
- =SUMPRODUCT((LEN(Rng)-LEN(SUBSTITUTE(Rng,G1,"")))/LEN(G1))
- =FindPhrase(Rng,G1)
- Option Explicit
- Function FindPhrase(SearchRange As Range, Phrase As String) As Long
- Dim RE As Object, MC As Object
- Dim sPat As String
- Dim V As Variant
- Dim I As Long, J As Long
- V = SearchRange
- Set RE = CreateObject("vbscript.regexp")
- With RE
- .Global = True
- .MultiLine = True
- .ignorecase = True
- .Pattern = "(?:^|,s*)" & Phrase & "(?:s*,|$)"
- End With
- For I = 1 To UBound(V, 1)
- If RE.test(V(I, 1)) Then J = J + 1
- Next I
- FindPhrase = J
- End Function
- .Pattern = "(?:^|,s*)Positive(?=(?:s*,|$))"
- Option Explicit
- Function FindPhrase2(SearchRange As Range, Phrase As String) As Long
- Dim V As Variant
- Dim I As Long, J As Long, K As Long
- Dim aStrings As Variant
- V = SearchRange
- For I = 1 To UBound(V)
- aStrings = Split(V(I, 1), ",")
- If IsArray(aStrings) Then
- For J = 0 To UBound(aStrings)
- If Trim(aStrings(J)) = Trim(Phrase) Then K = K + 1
- Next J
- Else
- If Trim(aStrings) = Trim(Phrase) Then K = K + 1
- End If
- Next I
- FindPhrase2 = K
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement