Subject: reverse partial lookup.

ellison

Active Member
Joined
Aug 1, 2012
Messages
337
Office Version
  1. 365
Platform
  1. Windows
Hi, we need to do a “reverse partial lookup”.

i.e. we have a list of old_product_codes (Col A) and new_product_codes (col B).

And we need to know if any of the new_product_codes contain (or equal) any of the old_product_codes

We have found ways of making this work on smaller lists, but we now have 317K new_product_codes and 40,000 old_product_codes.

And any method we have tried has timed out. Or crashed Excel.

If you have any suggestions, we would gladly take a look!

Quick Sample:
Old_product_does(smaller list)blanknew_product_codes(larger list)blankcontain or equals
ZVN0106B

<tbody>
</tbody>
ZV374Y
ZV374

<tbody>
</tbody>
ASSN01958141222Y
MC04ZE047

<tbody>
</tbody>
SMS996D1

<tbody>
</tbody>
N
SN0195814

<tbody>
</tbody>
LT1004MH25883

<tbody>
</tbody>
N
1111ZVN0106B16Y
54LS00BCAJC

<tbody>
</tbody>
N
73X014M001

<tbody>
</tbody>
N

<tbody>
</tbody>
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
maybe like this, with PowerQuery

OldNewNewOld.1Custom
ZVN0106BZV374ZV374ZVN0106BN
ZV374ASSN01958141222ZV374ZV374Y
MC04ZE047SMS996D1ZV374MC04ZE047N
SN0195814LT1004MH25883ZV374SN0195814N
1111ZVN0106B16ASSN01958141222ZVN0106BN
54LS00BCAJCASSN01958141222ZV374N
73X014M001ASSN01958141222MC04ZE047N
ASSN01958141222SN0195814Y
SMS996D1ZVN0106BN
SMS996D1ZV374N
SMS996D1MC04ZE047N
SMS996D1SN0195814N
LT1004MH25883ZVN0106BN
LT1004MH25883ZV374N
LT1004MH25883MC04ZE047N
LT1004MH25883SN0195814N
1111ZVN0106B16ZVN0106BY
1111ZVN0106B16ZV374N
1111ZVN0106B16MC04ZE047N
1111ZVN0106B16SN0195814N
54LS00BCAJCZVN0106BN
54LS00BCAJCZV374N
54LS00BCAJCMC04ZE047N
54LS00BCAJCSN0195814N
73X014M001ZVN0106BN
73X014M001ZV374N
73X014M001MC04ZE047N
73X014M001SN0195814N

Code:
[SIZE=1]let
    Source = Table1,
    #"Added Custom" = Table.AddColumn(Source, "Old", each Table2),
    #"Expanded Old" = Table.ExpandTableColumn(#"Added Custom", "Old", {"Old"}, {"Old.1"}),
    #"Added Conditional Column" = Table.AddColumn(#"Expanded Old", "Custom", each if Text.Contains([New], [Old.1]) then "Y" else "N")
in
    #"Added Conditional Column"[/SIZE]
 
Upvote 0
That looks excellent, that'll be our first "power query" so we may be on a bit of a learning curve getting that working!
BUT certainly look forward to getting my teeth into that..............
Thanks
 
Upvote 0
Excellent, that is a MUCH better place for me to start than the scratching of my head that I was doing, ha
 
Upvote 0
Hi,

Here's another way, formula copied down:


Book1
ABCDE
1Old_product_does(smaller list)new_product_codes(larger list)contain or equals
2ZVN0106BZV374Y
3ZV374ASSN01958141222Y
4MC04ZE047SMS996D1N
5SN0195814LT1004MH25883N
61111ZVN0106B16Y
754LS00BCAJCN
873X014M001N
Sheet384
Cell Formulas
RangeFormula
E2=IF(ISNUMBER(LOOKUP(2,1/SEARCH(A$2:A$5,C2))),"Y","N")
 
Upvote 0

Forum statistics

Threads
1,214,515
Messages
6,119,973
Members
448,933
Latest member
Bluedbw

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