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:
TABLE:
[TABLE="class: grid"]
<tbody>[TR]
[TD]Row\Col[/TD]
[TD]
[TD]
[TD]
[TD]
[TD]
[TD]
[/TR]
[TR]
[TD]
[TD]No.[/TD]
[TD]Name1[/TD]
[TD]Name2[/TD]
[TD]Problems[/TD]
[TD][/TD]
[TD]Non-Sorted Name[/TD]
[/TR]
[TR]
[TD]
[TD]
[TD]SEE CHAN MA APPLE JOHN
/ SEE CHAN YO KEEL BABY(JOINT NAME)[/TD]
[TD]John, See chan ma apple
Baby, See chan yo keel[/TD]
[TD]Line Break, Comma[/TD]
[TD][/TD]
[TD]John, See chan ma apple
Baby, See chan yo keel[/TD]
[/TR]
[TR]
[TD]
[TD]
[TD]XA,YOO / LEE_JBO(JOINT NAME)[/TD]
[TD]Xa Yoo
Jbo, Lee[/TD]
[TD]Line Break, Comma[/TD]
[TD][/TD]
[TD]Alevel Super Sgo M. J.[/TD]
[/TR]
[TR]
[TD]
[TD]
[TD]HE, XIA CHAN
DAN, DONGWANG[/TD]
[TD]Dong, wang Dan
Xiachan He[/TD]
[TD]Name Reverse[/TD]
[TD][/TD]
[TD]Catup Mum Leo A.[/TD]
[/TR]
[TR]
[TD]
[TD]
[TD]ALEVEL, SUPER SGO MOTHER JESSY[/TD]
[TD]Alevel Super Sgo M. J.[/TD]
[TD]Abbreviation[/TD]
[TD][/TD]
[TD]chin hu, offline
cgo kathy, online[/TD]
[/TR]
[TR]
[TD]
[TD]
[TD]Catup, Mum Leo April[/TD]
[TD]Catup Mum Leo A.[/TD]
[TD]Abbreviation[/TD]
[TD][/TD]
[TD]CO JUSUPER[/TD]
[/TR]
[TR]
[TD]
[TD]
[TD]COO, THAN[/TD]
[TD]THAN COO[/TD]
[TD]Name Reverse, Comma[/TD]
[TD][/TD]
[TD]CO JU-YEAH[/TD]
[/TR]
[TR]
[TD]
[TD]
[TD]ONLINE CGO KATHY / OFFLINE CHIN HU (JOINT NAME)[/TD]
[TD]chin hu, offline
cgo kathy, online[/TD]
[TD]Name Reverse, Joint Name, Line Break[/TD]
[TD][/TD]
[TD]Dong, wang Dan
Xiachan He[/TD]
[/TR]
[TR]
[TD]
[TD]
[TD]TAMKOO LO[/TD]
[TD]Tam Koo, Lo[/TD]
[TD]Name padded[/TD]
[TD][/TD]
[TD]JU YUPER, QO[/TD]
[/TR]
[TR]
[TD]
[TD]
[TD]LI, MARYME[/TD]
[TD]Marymeli[/TD]
[TD]Name Reverse+Name padded, comma[/TD]
[TD][/TD]
[TD]JU-YEAH-AO[/TD]
[/TR]
[TR]
[TD]
[TD]
[TD]Zoo, catup_SHAN[/TD]
[TD]Zoo shan catup[/TD]
[TD]underscore, comma[/TD]
[TD][/TD]
[TD]Mary, Co Yu Yeah[/TD]
[/TR]
[TR]
[TD]
[TD]
[TD]CO-JU YEAH[/TD]
[TD]CO JU-YEAH[/TD]
[TD]Duplicated first name[/TD]
[TD][/TD]
[TD]Marymeli[/TD]
[/TR]
[TR]
[TD]
[TD]
[TD]CO JU Mary YEAH[/TD]
[TD]Mary, Co Yu Yeah[/TD]
[TD]Duplicated first name with one name[/TD]
[TD][/TD]
[TD]Playu, So_Ju[/TD]
[/TR]
[TR]
[TD]
[TD]
[TD]CO JU SUPER[/TD]
[TD]CO JUSUPER[/TD]
[TD]Duplicated first name with name padded[/TD]
[TD][/TD]
[TD]Roger, CO_JU-SUPER[/TD]
[/TR]
[TR]
[TD]
[TD]
[TD]CO JU SUPER, ROGER[/TD]
[TD]Roger, CO_JU-SUPER[/TD]
[TD]Duplicated first name with name padded+Name Reverse[/TD]
[TD][/TD]
[TD]SO JU YEAH[/TD]
[/TR]
[TR]
[TD]
[TD]
[TD]SO JU YEAH[/TD]
[TD]SO JU YEAH[/TD]
[TD]Duplicated Last 2 name(from No.12)[/TD]
[TD][/TD]
[TD]SO JU_YUPER[/TD]
[/TR]
[TR]
[TD]
[TD]
[TD]SO JU YUPER[/TD]
[TD]SO JU_YUPER[/TD]
[TD]Duplicated first name with last name different[/TD]
[TD][/TD]
[TD]Tam Koo, Lo[/TD]
[/TR]
[TR]
[TD]
[TD]
[TD]SO JU PLAY U[/TD]
[TD]Playu, So_Ju[/TD]
[TD]Duplicated first name with last name different+Name Reverse+padded[/TD]
[TD][/TD]
[TD]THAN COO[/TD]
[/TR]
[TR]
[TD]
[TD]
[TD]QO YUPER JU[/TD]
[TD]JU YUPER, QO[/TD]
[TD]Duplicated Last name with surname name different[/TD]
[TD][/TD]
[TD]Xa Yoo
Jbo, Lee[/TD]
[/TR]
[TR]
[TD]
[TD]
[TD]AO JU YEAH![/TD]
[TD]JU-YEAH-AO[/TD]
[TD]Duplicated Last name with last name different+Name Reverse+padded[/TD]
[TD][/TD]
[TD]Zoo shan catup[/TD]
[/TR]
[TR]
[TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
[TD][/TD]
[TD]Given Blue, I want to return Red!!!!![/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
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:
TABLE:
[TABLE="class: grid"]
<tbody>[TR]
[TD]Row\Col[/TD]
[TD]
A
[/TD][TD]
B
[/TD][TD]
C
[/TD][TD]
D
[/TD][TD]
E
[/TD][TD]
F
[/TD][/TR]
[TR]
[TD]
1
[/TD][TD]No.[/TD]
[TD]Name1[/TD]
[TD]Name2[/TD]
[TD]Problems[/TD]
[TD][/TD]
[TD]Non-Sorted Name[/TD]
[/TR]
[TR]
[TD]
2
[/TD][TD]
1
[/TD][TD]SEE CHAN MA APPLE JOHN
/ SEE CHAN YO KEEL BABY(JOINT NAME)[/TD]
[TD]John, See chan ma apple
Baby, See chan yo keel[/TD]
[TD]Line Break, Comma[/TD]
[TD][/TD]
[TD]John, See chan ma apple
Baby, See chan yo keel[/TD]
[/TR]
[TR]
[TD]
3
[/TD][TD]
2
[/TD][TD]XA,YOO / LEE_JBO(JOINT NAME)[/TD]
[TD]Xa Yoo
Jbo, Lee[/TD]
[TD]Line Break, Comma[/TD]
[TD][/TD]
[TD]Alevel Super Sgo M. J.[/TD]
[/TR]
[TR]
[TD]
4
[/TD][TD]
3
[/TD][TD]HE, XIA CHAN
DAN, DONGWANG[/TD]
[TD]Dong, wang Dan
Xiachan He[/TD]
[TD]Name Reverse[/TD]
[TD][/TD]
[TD]Catup Mum Leo A.[/TD]
[/TR]
[TR]
[TD]
5
[/TD][TD]
5
[/TD][TD]ALEVEL, SUPER SGO MOTHER JESSY[/TD]
[TD]Alevel Super Sgo M. J.[/TD]
[TD]Abbreviation[/TD]
[TD][/TD]
[TD]chin hu, offline
cgo kathy, online[/TD]
[/TR]
[TR]
[TD]
6
[/TD][TD]
6
[/TD][TD]Catup, Mum Leo April[/TD]
[TD]Catup Mum Leo A.[/TD]
[TD]Abbreviation[/TD]
[TD][/TD]
[TD]CO JUSUPER[/TD]
[/TR]
[TR]
[TD]
7
[/TD][TD]
7
[/TD][TD]COO, THAN[/TD]
[TD]THAN COO[/TD]
[TD]Name Reverse, Comma[/TD]
[TD][/TD]
[TD]CO JU-YEAH[/TD]
[/TR]
[TR]
[TD]
8
[/TD][TD]
8
[/TD][TD]ONLINE CGO KATHY / OFFLINE CHIN HU (JOINT NAME)[/TD]
[TD]chin hu, offline
cgo kathy, online[/TD]
[TD]Name Reverse, Joint Name, Line Break[/TD]
[TD][/TD]
[TD]Dong, wang Dan
Xiachan He[/TD]
[/TR]
[TR]
[TD]
9
[/TD][TD]
9
[/TD][TD]TAMKOO LO[/TD]
[TD]Tam Koo, Lo[/TD]
[TD]Name padded[/TD]
[TD][/TD]
[TD]JU YUPER, QO[/TD]
[/TR]
[TR]
[TD]
10
[/TD][TD]
10
[/TD][TD]LI, MARYME[/TD]
[TD]Marymeli[/TD]
[TD]Name Reverse+Name padded, comma[/TD]
[TD][/TD]
[TD]JU-YEAH-AO[/TD]
[/TR]
[TR]
[TD]
11
[/TD][TD]
11
[/TD][TD]Zoo, catup_SHAN[/TD]
[TD]Zoo shan catup[/TD]
[TD]underscore, comma[/TD]
[TD][/TD]
[TD]Mary, Co Yu Yeah[/TD]
[/TR]
[TR]
[TD]
12
[/TD][TD]
12
[/TD][TD]CO-JU YEAH[/TD]
[TD]CO JU-YEAH[/TD]
[TD]Duplicated first name[/TD]
[TD][/TD]
[TD]Marymeli[/TD]
[/TR]
[TR]
[TD]
13
[/TD][TD]
13
[/TD][TD]CO JU Mary YEAH[/TD]
[TD]Mary, Co Yu Yeah[/TD]
[TD]Duplicated first name with one name[/TD]
[TD][/TD]
[TD]Playu, So_Ju[/TD]
[/TR]
[TR]
[TD]
14
[/TD][TD]
14
[/TD][TD]CO JU SUPER[/TD]
[TD]CO JUSUPER[/TD]
[TD]Duplicated first name with name padded[/TD]
[TD][/TD]
[TD]Roger, CO_JU-SUPER[/TD]
[/TR]
[TR]
[TD]
15
[/TD][TD]
15
[/TD][TD]CO JU SUPER, ROGER[/TD]
[TD]Roger, CO_JU-SUPER[/TD]
[TD]Duplicated first name with name padded+Name Reverse[/TD]
[TD][/TD]
[TD]SO JU YEAH[/TD]
[/TR]
[TR]
[TD]
16
[/TD][TD]
16
[/TD][TD]SO JU YEAH[/TD]
[TD]SO JU YEAH[/TD]
[TD]Duplicated Last 2 name(from No.12)[/TD]
[TD][/TD]
[TD]SO JU_YUPER[/TD]
[/TR]
[TR]
[TD]
17
[/TD][TD]
17
[/TD][TD]SO JU YUPER[/TD]
[TD]SO JU_YUPER[/TD]
[TD]Duplicated first name with last name different[/TD]
[TD][/TD]
[TD]Tam Koo, Lo[/TD]
[/TR]
[TR]
[TD]
18
[/TD][TD]
18
[/TD][TD]SO JU PLAY U[/TD]
[TD]Playu, So_Ju[/TD]
[TD]Duplicated first name with last name different+Name Reverse+padded[/TD]
[TD][/TD]
[TD]THAN COO[/TD]
[/TR]
[TR]
[TD]
19
[/TD][TD]
19
[/TD][TD]QO YUPER JU[/TD]
[TD]JU YUPER, QO[/TD]
[TD]Duplicated Last name with surname name different[/TD]
[TD][/TD]
[TD]Xa Yoo
Jbo, Lee[/TD]
[/TR]
[TR]
[TD]
20
[/TD][TD]
20
[/TD][TD]AO JU YEAH![/TD]
[TD]JU-YEAH-AO[/TD]
[TD]Duplicated Last name with last name different+Name Reverse+padded[/TD]
[TD][/TD]
[TD]Zoo shan catup[/TD]
[/TR]
[TR]
[TD]
21
[/TD][TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
22
[/TD][TD][/TD]
[TD]Given Blue, I want to return Red!!!!![/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]