FIND does not pick up phrases unless its an exact match. As explained below

chazrab

Well-known Member
Joined
Oct 21, 2006
Messages
918
Office Version
  1. 365
Platform
  1. Windows
I know that Jesus said, "If you abide in My Word you shall know the truth and the truth shall make you free"
Different translations have different phrase words
If I use Find to search for all matches from Gen to Rev of "if you abide in My Word"
Find won't pick it up
If I type in "if you continue in My Word" Find will return all matches

Correct code for a phrase search would pick up both, whether the phrase has "abide" or "continue"
So I don't know if the LIKE operator is applicable here, but inexact or near phrases using the other words of
the phrase before and after "abide" or "continue" should pick up all phrases regardless of which words are used.
This has been a real challenge - but if the web and other apps like Logos can do it, so should correctly coded VBA FIND - is my thinking.
My FIND code snippet:
Code:
With Worksheets("SOURCE") 'default NASB
    Set c = rngSrc.FIND(X, LookIn:=xlValues, LookAt:=xlPart, MatchCase:=False, SearchFormat:=False)
    If Not c Is Nothing Then
        rw = 1
        firstAddress = c.Address
        Do
            If InStr(1, c.Value, Y, vbTextCompare) > 0 Then
                .Range(.Cells(c.Row, 2), .Cells(c.Row, 7)).Copy Destination:=Sheets("VALSFOUND").Range("A" & rw)   '
                rw = rw + 1
            End If
            Set c = rngSrc.FindNext(c)
        Loop While c.Address <> firstAddress
        lastrow = Sheets("VALSFOUND").Range("A" & Rows.count).End(xlUp).Row
    Else
        MsgBox "value not found"
    End If

This line does not check for similar but not exact word phrases if two different words have the same meaning. ( a real world translation issue)
Code:
   If InStr(1, c.Value, Y, vbTextCompare) > 0 Then...
Any help appreciated.
cr
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
I've done this before - it checks how 'matchy' two phrases are. Then gives a percentage. Maybe you can do something like this and return things with high percentages for a human to look at.

Fuzzy Match.xlsx
ABCDE
1Search PhraseExclusions
2if you continue abide in My Word.the
3,of
4Test PhrasesMatchiness?and
5That is the goose that doesn't hard work at all.0.0%!to
6Four score and seven years ago, our forefathers put forth on this land some good stuff.3.3%in
7And the nation, so founded, shall not perish from this earth.0.0%is
8flood dye test shower cubicle including checking of all drainage to determine cause of leak. Prepare and submit written report to Principal.12.8%you
9Dye test wet areas and inspect drainage to determine defects. Provide report and fully itemise all defects identified, including photos.20.0%a
10If you abide in My Word you shall know the truth and the truth shall make you free62.7%that
11If you continue in My Word you shall know the truth and the truth shall make you free72.7%it
Soft match
Cell Formulas
RangeFormula
B5:B11B5=LET(x,SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A$2,$D$2,""),$D$3,""),$D$4,""),$D$5,""),y,SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A5,$D$2,""),$D$3,""),$D$4,""),$D$5,""),z,$E$2:$E$11,a,TEXTSPLIT(x,," "),b,TEXTSPLIT(y,," "),aa,FILTER(a,ISNA(XMATCH(a,z))),bb,FILTER(b,ISNA(XMATCH(b,z))),c,SUM(ISNUMBER(SEARCH(a,TEXTJOIN(" ",TRUE,bb)))+0)/ROWS(aa),d,SUM(ISNUMBER(SEARCH(b,TEXTJOIN(" ",TRUE,aa)))+0)/ROWS(bb),AVERAGE(c,d))
 
Upvote 0

Forum statistics

Threads
1,224,272
Messages
6,177,634
Members
452,787
Latest member
BeeTH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top