Hi, I have 2 lists containing thousands of records with numbers only having 3 to 17 digits each.
I need to compare the lists between them to find non partial matching records and I was able to do so however this is getting more complicated since I need to compare one digit at a time.
Then I need to merge the results and do another filtering.
Pls see below example to explan what I need since it is complicated .
List 1
123456
23232312
231
23232
456
List 2
12345
231321
456321
2323
The result that I have achieved is shown below
Result for List 2 when compared to List 1
12345 (NEW Entry since List 1 contains 123456 and is longer)
231321 (NEW Entry since List 1 does not contain this number)
456321 (Already exist since List 1 contains already 456 number and is shorter)
2323 (NEW Entry since List 1 contains 23232312 and is longer)
Now I need to merge both lists and filter. The result should be as follows.
Merged List
123456 (This will be deleted since 12345 already exists in List 2 and is shorter)
23232312 (This will be deleted since 2323 already exists in List 2 and is shorter)
231 (This entry will be kept since it is shorter than entry 231321 from List 2)
23232 (This will be deleted since 2323 already exists in List 2 and is shorter)
456 (This entry will be kept since there is no matching number)
12345 (This entry will be kept since 123456 from List 1 already exists however it is longer)
231321 (This will be deleted since 231 already exists in List 1 and is shorter)
456321 (This will be deleted since 456 already exists in List 1 and is shorter)
2323 (This entry will be kept since it is shorter than entry 23232312 from List 1)
So I should end up with the following results
Final List
231
456
12345
2323
I know that it is complicated however the above example might help to explain what I need. Any help please?
I can’t do this with basic filtering or sorting. I am using INDEX and MATCH to achieve the first part but now I need to achieve the last step.
Thanks
Bookmarks