V-lookup function on Primary key with multiple variations

Copper Contributor

Hello Experts ,

 

I have 2 tables in my workbook. Table A has below columns. In Table A I need name of customers from Table B on the basis of Invoice Number.

 

TABLE A
Invoice no.QtyAmountNeed name of Customer
7721100 
7022500 
GST/0621/20-213600 
B2B/0623/20-214300 
6275200 
B2B/6306800 
4407950 
470/2019-208750 
GST/0650/20-219300 
2454703811050 
MIS245470380111000 
GST/06545/202112835 

 

Table B has below format and I need sale amount here from Table A on the basis of Invoice No. 

 

TABLE B
Invoice no.Name of CustomerNeed Amount
RKS/772/20-21A 
MGPCL/702/20-21B 
621X 
B2B/0623E 
B2B/0627/20-21R 
630F 
GST/440/2019-20G 
470T 
B2B/0650/20-21M 
MIS245470381J 
MIS24547000380K 
B2B/0645/20-21Y 

 

But as there are multiple variation in Invoice Number in both the table , vlookup function is not working properly. Pls guide how to resolve this.

 

Thanks a ton in advance for sparing time for me in replying.

 

Varsit N Shah

7 Replies

Hi @Varsit_N_Shah ,

Probably not the best approach but I used a calculated column for wild cards and then xlookup

=XLOOKUP("*"&B3&"*",$H$3:$H$14,$I$3:$I$14,"",2,1) 
you can also use this directly instead of the calculated column, works the same

@saybhatt 

 

Hi @saybhatt 

 

Thank you so much for the new insight. It worked but not 100%. 

 

Varsit N. Shah

@Varsit_N_Shah : Hi, in which case did the formula stand incorrect, will try to sort it out?

@saybhatt 

 

Hi , I have attached file for your reference. Mainly it didn't worked at places where wild card characters are not there in the lookup value associated in lookup array. 

@Varsit_N_Shah 

If I understood correctly we lookup when any part of lookup value text shall met any part of the texts in lookup array. Afraid that doesn't work, bit more logic is required. For example, shall we consider GST/0650/20-21 and B2B/0650/20-21 as matched and why?