Fuzzy Matching - new version plus explanation

al_b_cnu

Well-known Member
Joined
Jul 18, 2003
Messages
4,546
It has been a while since I originally posted my Fuzzy matching UDF’s on the board, and several variants have appeared subsequently.

I thought it time to ‘put the record straight’ & post a definitive version which contains slightly more efficient code, and better matching algorithms, so here it is.

Firstly, I must state that the Fuzzy matching algorithms are very CPU hungry, and should be used sparingly. If for instance you require to lookup a match for a string which starts with, contains or ends with a specified value, this can be performed far more efficiently using the MATCH function:
Fuzzy Examples.xls
ABCDE
1Starts WithEndsContains
2BilljelenBill
3Mr Bill Jelen433
4Bill Jelen
5Joe Bloggs
6Fred Smith
MATCH Example


... Continued ...
 
Hi, I am trying to match a short description to a different set of data/descriptions. The descriptions I am trying to compare to are not exactly the same. Some may be longer or shorter and/or have extra/less words. Once I match the values, i need to get a value that has a "table location" in a different column. Is there a way to pull up the "table location" value as well as the result from the algorithm?

Hi,

Try setting the 'IndexNum' value to 0 - it will return the best match row number.
 
Upvote 0

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Hi,

Try setting the 'IndexNum' value to 0 - it will return the best match row number.

Probably a dumb question, but where would i change that :nervous:

Also, is there a way to have the fuzzyvlookup look at multiple words in the lookup value cell AND the lookup table cells? Because some of my values have the same first word, but different words after that. For example, Amputation of the Arm, Amputation of the Finger. All pull up the same value, which is neither Arm or Finger lol.
 
Last edited:
Upvote 0
Not really, I think you'll have to write a bespoke UDF.

Unfortunately (for you thsat is), I'm off to somewhere far sunnier than manchester for a week as of 4am tomorrow morning, so unless you can wait a week, suggest you post a new thread.
Failing that, by all means PM me & I'll see what we can come up with :)
 
Upvote 0
Not really, I think you'll have to write a bespoke UDF.

Unfortunately (for you thsat is), I'm off to somewhere far sunnier than manchester for a week as of 4am tomorrow morning, so unless you can wait a week, suggest you post a new thread.
Failing that, by all means PM me & I'll see what we can come up with :)

Take me with you? :laugh: I will post a new thread and see what they come up with and if that doesnt work, I will PM you. Because i dont know what a bespoke UDF is lol.
 
Upvote 0
Hi Alan, I am trying to use the fuzzyvlookup for another project I'm working on! This should be relatively simple, I just need to match names of conference attendees to a master roster. When the attendees sign into the conference, they don't always write their name the way it is in the roster. In the roster there are fields that I need to pull (ie ID number, department, department section, etc). How could I make the fuzzylookup match the name from the attendance list to the name in the roster?
 
Upvote 0
I keep getting the #NAME? error. When i look at the arguments in the function, it is showing the lookup value as the #value! error. Do the columns have to be set up a specific way? Also, the main roster I am using as the lookup table is in a separate workbook. Does that matter?
 
Upvote 0
I keep getting the #NAME? error. When i look at the arguments in the function, it is showing the lookup value as the #value! error. Do the columns have to be set up a specific way? Also, the main roster I am using as the lookup table is in a separate workbook. Does that matter?

Hi,

if the columns are set up as you would do so for the inbuilt VLOOKUP, you should be ok.
For this version of FuzzyVLookup, the lookup table must be in the same workbook as the module.
 
Upvote 0

Forum statistics

Threads
1,223,922
Messages
6,175,384
Members
452,639
Latest member
RMH2024

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