Extreme Complicated Name Matching (Using Function/VBA) REVISED

mikeleung110

New Member
Joined
Nov 5, 2015
Messages
13
Extreme Complicated Name Matching (Using Function/VBA) REVISED


OLD POST:http://www.mrexcel.com/forum/excel-...on-visual-basic-applications.html#post4462510




Dear all,
I encounter difficult problem that is related to matching some customer names.
I have 2 Col, Col B(Name1) is raw data Col;Col F(Non-Sorted Name) is another name Col with difficult naming pattern which is not exactly matches.


Given: Col B (Raw data Col) , Col F (i.e. non-sorted names Col)


Task: Return the names of Col C (Name2) , i.e. Given Blue, I want to return Red!!!!!


You can see the image and the image can explain all the problems!!!


Actually it is just like a kind of "GOOGLE SEARCH" and searching names that matches with the most of the characters in the greatest amount of extent.
Actually, I think this nightmare problems just like "GOOGLE SEARCH"
That means finding a string and then highlighting the true hit parts / return the greatest extent of matches answers if possible.





ANOTHER LINK:
x602sle0h



TABLE:


Row\Col
A​
B​
C​
D​
E​
F​
1​
No.Name1Name2ProblemsNon-Sorted Name
2​
1
SEE CHAN MA APPLE JOHN
/ SEE CHAN YO KEEL BABY(JOINT NAME)
John, See chan ma apple
Baby, See chan yo keel
Line Break, CommaJohn, See chan ma apple
Baby, See chan yo keel
3​
2
XA,YOO / LEE_JBO(JOINT NAME)Xa Yoo
Jbo, Lee
Line Break, CommaAlevel Super Sgo M. J.
4​
3
HE, XIA CHAN
DAN, DONGWANG
Dong, wang Dan
Xiachan He
Name ReverseCatup Mum Leo A.
5​
5
ALEVEL, SUPER SGO MOTHER JESSYAlevel Super Sgo M. J.Abbreviationchin hu, offline
cgo kathy, online
6​
6
Catup, Mum Leo AprilCatup Mum Leo A.AbbreviationCO JUSUPER
7​
7
COO, THANTHAN COOName Reverse, CommaCO JU-YEAH
8​
8
ONLINE CGO KATHY / OFFLINE CHIN HU (JOINT NAME)chin hu, offline
cgo kathy, online
Name Reverse, Joint Name, Line BreakDong, wang Dan
Xiachan He
9​
9
TAMKOO LOTam Koo, LoName paddedJU YUPER, QO
10​
10
LI, MARYMEMarymeliName Reverse+Name padded, commaJU-YEAH-AO
11​
11
Zoo, catup_SHANZoo shan catupunderscore, commaMary, Co Yu Yeah
12​
12
CO-JU YEAHCO JU-YEAHDuplicated first nameMarymeli
13​
13
CO JU Mary YEAHMary, Co Yu YeahDuplicated first name with one namePlayu, So_Ju
14​
14
CO JU SUPERCO JUSUPERDuplicated first name with name paddedRoger, CO_JU-SUPER
15​
15
CO JU SUPER, ROGERRoger, CO_JU-SUPERDuplicated first name with name padded+Name ReverseSO JU YEAH
16​
16
SO JU YEAHSO JU YEAHDuplicated Last 2 name(from No.12)SO JU_YUPER
17​
17
SO JU YUPERSO JU_YUPERDuplicated first name with last name differentTam Koo, Lo
18​
18
SO JU PLAY UPlayu, So_JuDuplicated first name with last name different+Name Reverse+paddedTHAN COO
19​
19
QO YUPER JUJU YUPER, QODuplicated Last name with surname name differentXa Yoo
Jbo, Lee
20​
20
AO JU YEAH!JU-YEAH-AODuplicated Last name with last name different+Name Reverse+paddedZoo shan catup
21​
22​
Given Blue, I want to return Red!!!!!

<tbody>
</tbody>
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
No Excel Guru can solve this problems?

Actually I think of several task to do but it sucks:
Task 1: Remove all of the symbol like comma, underscore, and etc, leaving only string by using function: substitute

Task 2: Trim and remove all the trailing blanks and spaces, line break and etc by using function: trim, substitute

Task 1 & 2 are only work for the Names in correct naming order, e.g. Dan, Dongwang VS Dan Dong Wang

Task 3 But how about the task of NAME REVERSE?? e.g. Dan, Dong Wang VS Dong Wang Dan
OK, you may solve Task 3 by separating the Name into 3 items and then compare: First Name, Middle Name & Last Name. (i.e. First: Dan; Middle: Wang; Last Wang Dan)
OR Just compare the Last 2 Names (i.e. Dong Wang)

Task 4 However, What if the scenorio turns to NAME REVERSE+NAME PADDED? e.g. (Dan, DongWang VS Dong Wang Dan)
Excel can only separate 2 names with space/comma/underscore detection, in which detect "DongWang" is ONLY 1 FIRST NAME instead of 2 FIRST NAME
It starts to become more difficult...

Task 5 OK, Nevertheless, suppose you can finish the Task 3, how about dealing with DUPLICATED Names with 2 SAME FIRST NAME?
(e.g. San, Dong Wang VS Dan, Dong Wang)

INDEX+MATCH/VLOOKUP only returns ONE EXACT solution for only one cells, it cannot deplays more than 1 solution in one cells.

Task 6 What if the more worse thing is that, Abbreivation appears in the cells? (e.g. Dan, Dong Wang VS Dan, D.W.)
NO ONE can know whether D.W. stands for Dong Wang except only EYE BALLS?

Task 7 Duplicated 2 First Name OR Duplicated 2 Last Name (Just like Task 5, with addition of one more names)
E.g.
CO JU Mary YEAH VS Mary, Co Yu Yeah
CO JU SUPER VS CO JUSUPER

Task 8 What if ALL problems are linked together?
COMMA+Underline+Underscore+Line Break+Trailing Space+NAME REVERSE+NAME PADDED+ABBREVIATION+Duplicated 2 First Name+ Duplicated 2 Last Name

Is it a nightmare?

CAN ANY EXCEL GURU SOLVE MY PROBLEMS by using function/<acronym title="visual basic for applications" style="border-width: 0px 0px 1px; border-bottom-style: dotted; border-bottom-color: rgb(0, 0, 0); cursor: help; color: rgb(51, 51, 51); background-color: rgb(250, 250, 250);">VBA</acronym>/other methods?
 
Upvote 0

Forum statistics

Threads
1,215,326
Messages
6,124,265
Members
449,149
Latest member
mwdbActuary

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