Demosassiner
New Member
- Joined
- Aug 13, 2017
- Messages
- 7
Hey guys, so after racking my brain for over a week trying to come out with a way to do this myself, I decided to ask for help. I don't even know if this is possible but here goes.
A colleague sends me the input, where he wants to match Microsoft Inc's Code "Micro" to Code "MICR" based on the exact number match of the number "0010"
Problem is, the "name" that he sends isn't always an exact match to the names in the main table, e.g. He sends Microsoft Inc which I need to match to Microsoft Ltd from the table.
I need a formula/macro/script to, match the "input" number with the "table" number, and then from all the table numbers' it matches, match the "input" name with the "table" name (which will have to be an approximate/fuzzy match), and then based on theses matches, return the appropriate CODE.
So, look at the main table and note all the number matches for 0010, then look at the names of these matches and do a best approximate match (Microsoft Inc to Microsoft Ltd), and then return the corresponding "from" and "to" codes (Micro to MICR).
Main Table
[TABLE="class: outer_border, width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]Code[/TD]
[TD]Number[/TD]
[/TR]
[TR]
[TD]Microsoft[/TD]
[TD][TABLE="width: 65"]
<tbody>[TR="class: outer_border"]
[TD="width: 65"]MSFT[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 65"]
<tbody>[TR="class: outer_border"]
[TD="width: 65"]0005[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 65"]
<tbody>[TR="class: outer_border"]
[TD="width: 65"]Microsoft Ltd[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 65"]
<tbody>[TR="class: outer_border"]
[TD="width: 65"]MICR[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]0010[/TD]
[/TR]
[TR]
[TD][TABLE="width: 65"]
<tbody>[TR="class: outer_border"]
[TD="width: 65"]Apple Inc[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 65"]
<tbody>[TR="class: outer_border"]
[TD="width: 65"]AAPL[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]0005[/TD]
[/TR]
[TR]
[TD][TABLE="width: 65"]
<tbody>[TR="class: outer_border"]
[TD="width: 65"]Apple (Foreign)[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 65"]
<tbody>[TR="class: outer_border"]
[TD="width: 65"]APLE[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]0010[/TD]
[/TR]
[TR]
[TD][TABLE="width: 65"]
<tbody>[TR="class: outer_border"]
[TD="width: 65"]Apple Co.[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 65"]
<tbody>[TR="class: outer_border"]
[TD="width: 65"]APCO[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]0222[/TD]
[/TR]
[TR]
[TD][TABLE="width: 65"]
<tbody>[TR="class: outer_border"]
[TD="width: 65"]Facebook[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]FCBK[/TD]
[TD]0050[/TD]
[/TR]
[TR]
[TD][TABLE="width: 65"]
<tbody>[TR="class: outer_border"]
[TD="width: 65"]Facebook Corp[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 65"]
<tbody>[TR="class: outer_border"]
[TD="width: 65"]FBBC[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 65"]
<tbody>[TR="class: outer_border"]
[TD="width: 65"]0010[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 65"]
<tbody>[TR="class: outer_border"]
[TD="width: 65"]Facebook LLC[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]FACE[/TD]
[TD]0111[/TD]
[/TR]
</tbody>[/TABLE]
Table 2 (INPUT)
[TABLE="class: outer_border, width: 500"]
<tbody>[TR]
[TD]Code[/TD]
[TD]Name[/TD]
[TD]Number[/TD]
[/TR]
[TR]
[TD]Micro[/TD]
[TD]Microsoft Inc[/TD]
[TD]0010[/TD]
[/TR]
[TR]
[TD]Apple123[/TD]
[TD]Apple[/TD]
[TD]0005[/TD]
[/TR]
[TR]
[TD][TABLE="width: 195"]
<tbody>[TR="class: outer_border"]
[TD]Fbook1[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]Facebook Inc[/TD]
[TD]0010[/TD]
[/TR]
</tbody>[/TABLE]
Table 3 (OUTPUT)
[TABLE="class: outer_border, width: 500"]
<tbody>[TR]
[TD]From Code[/TD]
[TD]To Code[/TD]
[TD]Number[/TD]
[/TR]
[TR]
[TD]Micro[/TD]
[TD]MICR[/TD]
[TD]0010[/TD]
[/TR]
[TR]
[TD]Apple123[/TD]
[TD]AAPL[/TD]
[TD]0005[/TD]
[/TR]
[TR]
[TD]Fbook1[/TD]
[TD]FBBC[/TD]
[TD]0010[/TD]
[/TR]
</tbody>[/TABLE]
A colleague sends me the input, where he wants to match Microsoft Inc's Code "Micro" to Code "MICR" based on the exact number match of the number "0010"
Problem is, the "name" that he sends isn't always an exact match to the names in the main table, e.g. He sends Microsoft Inc which I need to match to Microsoft Ltd from the table.
I need a formula/macro/script to, match the "input" number with the "table" number, and then from all the table numbers' it matches, match the "input" name with the "table" name (which will have to be an approximate/fuzzy match), and then based on theses matches, return the appropriate CODE.
So, look at the main table and note all the number matches for 0010, then look at the names of these matches and do a best approximate match (Microsoft Inc to Microsoft Ltd), and then return the corresponding "from" and "to" codes (Micro to MICR).
Main Table
[TABLE="class: outer_border, width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]Code[/TD]
[TD]Number[/TD]
[/TR]
[TR]
[TD]Microsoft[/TD]
[TD][TABLE="width: 65"]
<tbody>[TR="class: outer_border"]
[TD="width: 65"]MSFT[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 65"]
<tbody>[TR="class: outer_border"]
[TD="width: 65"]0005[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 65"]
<tbody>[TR="class: outer_border"]
[TD="width: 65"]Microsoft Ltd[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 65"]
<tbody>[TR="class: outer_border"]
[TD="width: 65"]MICR[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]0010[/TD]
[/TR]
[TR]
[TD][TABLE="width: 65"]
<tbody>[TR="class: outer_border"]
[TD="width: 65"]Apple Inc[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 65"]
<tbody>[TR="class: outer_border"]
[TD="width: 65"]AAPL[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]0005[/TD]
[/TR]
[TR]
[TD][TABLE="width: 65"]
<tbody>[TR="class: outer_border"]
[TD="width: 65"]Apple (Foreign)[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 65"]
<tbody>[TR="class: outer_border"]
[TD="width: 65"]APLE[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]0010[/TD]
[/TR]
[TR]
[TD][TABLE="width: 65"]
<tbody>[TR="class: outer_border"]
[TD="width: 65"]Apple Co.[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 65"]
<tbody>[TR="class: outer_border"]
[TD="width: 65"]APCO[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]0222[/TD]
[/TR]
[TR]
[TD][TABLE="width: 65"]
<tbody>[TR="class: outer_border"]
[TD="width: 65"]Facebook[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]FCBK[/TD]
[TD]0050[/TD]
[/TR]
[TR]
[TD][TABLE="width: 65"]
<tbody>[TR="class: outer_border"]
[TD="width: 65"]Facebook Corp[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 65"]
<tbody>[TR="class: outer_border"]
[TD="width: 65"]FBBC[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 65"]
<tbody>[TR="class: outer_border"]
[TD="width: 65"]0010[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 65"]
<tbody>[TR="class: outer_border"]
[TD="width: 65"]Facebook LLC[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]FACE[/TD]
[TD]0111[/TD]
[/TR]
</tbody>[/TABLE]
Table 2 (INPUT)
[TABLE="class: outer_border, width: 500"]
<tbody>[TR]
[TD]Code[/TD]
[TD]Name[/TD]
[TD]Number[/TD]
[/TR]
[TR]
[TD]Micro[/TD]
[TD]Microsoft Inc[/TD]
[TD]0010[/TD]
[/TR]
[TR]
[TD]Apple123[/TD]
[TD]Apple[/TD]
[TD]0005[/TD]
[/TR]
[TR]
[TD][TABLE="width: 195"]
<tbody>[TR="class: outer_border"]
[TD]Fbook1[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]Facebook Inc[/TD]
[TD]0010[/TD]
[/TR]
</tbody>[/TABLE]
Table 3 (OUTPUT)
[TABLE="class: outer_border, width: 500"]
<tbody>[TR]
[TD]From Code[/TD]
[TD]To Code[/TD]
[TD]Number[/TD]
[/TR]
[TR]
[TD]Micro[/TD]
[TD]MICR[/TD]
[TD]0010[/TD]
[/TR]
[TR]
[TD]Apple123[/TD]
[TD]AAPL[/TD]
[TD]0005[/TD]
[/TR]
[TR]
[TD]Fbook1[/TD]
[TD]FBBC[/TD]
[TD]0010[/TD]
[/TR]
</tbody>[/TABLE]