Hi,
I am comparing 2 workbooks in Excel. I have names in the 2 columns I am
trying to compare. The problem is the names can be slightly different
e.g. 1 Mysteria Lane could appear as 1 Mysteria Ln. in the other.
Therefore I cannot use exact matching.
I was going to use Vlookup and set the final setting to True to use an
approximate match but wanted to ensure there was no better way.
Please let me know if there is a better way of doing this or if anyone
can explain how the matching work when you use True in Vlookup I would
appreciate it,
Thanks,
P
David McRitchie - 02 Jul 2005 16:23 GMT
Hi Paul,
Try a search for soundex on John Walkebach's site.
Interestingly it did not show up, but I had actually used a more general search
that included others besides John, anyway his link is
Searching Using Soundex Codes
http://j-walk.com/ss/excel/tips/tip77.htm
Soundex is an indexing system that translates a name into a 4-digit code
consisting of one letter and three numbers.
which I found in Dick Kusleika's "Daily Dose" Blog at
"Fuzzy Text Match
http://www.dicks-blog.com/archives/2004/06/16/fuzzy-text-match/
so you may find additional information there as well.
Here is a Google web search that would just search John's site.
site:j-walk.com soundex excel [3 hits]
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm
> Hi,
>
[quoted text clipped - 13 lines]
>
> P
Dave Stice - 27 Jan 2006 18:21 GMT
Try this: I stole from someone else (with some modifications) so no
guarantees. But it worked for me.
Function SoundEx(Word As String) As String
Dim Result As String
Dim I As Long, Acode As Integer
Dim Dcode As Integer, OldCode As Integer
Dim WordAsc As Integer
' soundex is case-insensitive
Word = UCase(Word)
' the first letter is copied in the result
SoundEx = Left(Word, 1)
WordAsc = Asc(Word)
OldCode = 0
If WordAsc > 64 And WordAsc < 91 Then
OldCode = Asc(Mid("01230120022455012623010202", WordAsc - 64, 1))
End If
For I = 2 To Len(Word)
Acode = Asc(Mid$(Word, I, 1)) - 64
' discard non-alphabetic chars
If Acode >= 1 And Acode <= 26 Then
' convert to a digit
Dcode = Asc(Mid$("01230120022455012623010202", Acode, 1))
' don't insert repeated digits
If Dcode <> 48 And Dcode <> OldCode Then
SoundEx = SoundEx & Chr$(Dcode)
If Len(SoundEx) = 4 Then Exit For
End If
OldCode = Dcode
End If
Next
End Function
>Hi,
>
[quoted text clipped - 13 lines]
>
>P