Rate Similarity of Two Columns

kmprice710

Board Regular
Joined
Jan 8, 2014
Messages
87
Office Version
  1. 2019
Platform
  1. Windows
I have two columns of two data that are name-matched but they're not exactly the same.
Column A Column B
Dave Adams David Adams
John C. Hall Jack Hall
Pam Benedict Pamela Benedict

I'd like to have Excel look at the two cells for each row and say how similar they are, like 90%, 80%, etc. I don't need to know if they're exact matches. I know they're not; I do need to pick out ones that are the furthest from being matches.
Is there a way to do this?
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
You could utilize Power Query's fuzzy matching algorithm and then incorporate the SimilarityColumnName option to obtain the percentage match according to that algorithm. Starting with this table:
Book6
AB
1Name1Name2
2Dave AdamsDavid Adams
3John C. HallJack Hall
4Pam BenedictPamela Benedict
Sheet1

Power Query delivers this result:
Book6
ABC
1Name1Name2Similarity
2Dave AdamsDavid Adams0.41
3John C. HallJack Hall0.37
4Pam BenedictPamela Benedict0.41
Merge1

The M code for producing this result:
Power Query:
let
    Source = Table.FuzzyNestedJoin(Table1, {"Name1"}, Table1, {"Name2"}, "Table1", JoinKind.LeftOuter, [IgnoreCase=true, IgnoreSpace=true, Threshold=0.3, SimilarityColumnName="Similarity"]),
    #"Expanded Table1" = Table.ExpandTableColumn(Source, "Table1", {"Similarity"}, {"Similarity"})
in
    #"Expanded Table1"
 
Upvote 0

Forum statistics

Threads
1,215,102
Messages
6,123,099
Members
449,096
Latest member
provoking

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