required lookup with different lengths

ravi2628

Board Regular
Joined
Dec 20, 2017
Messages
221
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hi everyone,

good morning/afternoon/evening,

I was looking for a formula where I can get an exact match of the lookup with certain criteria


Sheet 1:

Propofol Injection 200mg
Enoxaparin Sodium 60mg
Heparin Sodium 25000IU
Enoxaparin Sodium 40mg
Polymyxin B Sulphate 500000 IU
Sterile Noradrenaline Conc Inj 20mg
Vancomycin Hcl 500mg
Atracurium Besylate 50mg
Omeprazole Injection 40mg
Sterile Noradrenaline Conc Inj 8mg
L-Asparaginase 10000IU
Oxaliplatin 100mg
Doxorubicin Hcl 50mg
Cytarabine 500mg

Mapping Sheet:

Propofol
Enoxaparin Sodium
Heparin
Enoxaparin Sodium
Polymyxin B Sulphate
Sterile Noradrenaline Conc inj
Vancomycin Hcl
Atracurium Besylate
Omeprazole Injection
Sterile Noradrenaline Conc
Doxorubicin Hcl

Output:
Propofol Injection 200mg
Enoxaparin Sodium 60mg
Heparin Sodium 25000IU
Enoxaparin Sodium 40mg
Polymyxin B Sulphate 500000 IU
Sterile Noradrenaline Conc Inj 20mg
Vancomycin Hcl 500mg
Atracurium Besylate 50mg
Omeprazole Injection 40mg
Sterile Noradrenaline Conc Inj 8mg
L-Asparaginase 10000IU
Oxaliplatin 100mg
Doxorubicin Hcl 50mg

I have tried using min length with vlookup but it is not working correctly


Currently using formula is vlookup(concatenate(left(Cell,13),"*"),array,1,0)

but not able to get the exact output at some point.

please help me out with the formula.

Regards,
Ravi
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Is this what you want?
Fluff.xlsm
ABCD
1
2Propofol Injection 200mgPropofolPropofol Injection 200mg
3Enoxaparin Sodium 60mgEnoxaparin SodiumEnoxaparin Sodium 60mg
4Heparin Sodium 25000IUHeparinHeparin Sodium 25000IU
5Enoxaparin Sodium 40mgEnoxaparin SodiumEnoxaparin Sodium 60mg
6Polymyxin B Sulphate 500000 IUPolymyxin B SulphatePolymyxin B Sulphate 500000 IU
7Sterile Noradrenaline Conc Inj 20mgSterile Noradrenaline Conc injSterile Noradrenaline Conc Inj 20mg
8Vancomycin Hcl 500mgVancomycin HclVancomycin Hcl 500mg
9Atracurium Besylate 50mgAtracurium BesylateAtracurium Besylate 50mg
10Omeprazole Injection 40mgOmeprazole InjectionOmeprazole Injection 40mg
11Sterile Noradrenaline Conc Inj 8mgSterile Noradrenaline ConcSterile Noradrenaline Conc Inj 20mg
12L-Asparaginase 10000IUDoxorubicin HclDoxorubicin Hcl 50mg
13Oxaliplatin 100mg
14Doxorubicin Hcl 50mg
15Cytarabine 500mg
Main
Cell Formulas
RangeFormula
D2:D12D2=VLOOKUP(C2&"*",$A$2:$A$15,1,0)
 
Upvote 0
Is this what you want?
Fluff.xlsm
ABCD
1
2Propofol Injection 200mgPropofolPropofol Injection 200mg
3Enoxaparin Sodium 60mgEnoxaparin SodiumEnoxaparin Sodium 60mg
4Heparin Sodium 25000IUHeparinHeparin Sodium 25000IU
5Enoxaparin Sodium 40mgEnoxaparin SodiumEnoxaparin Sodium 60mg
6Polymyxin B Sulphate 500000 IUPolymyxin B SulphatePolymyxin B Sulphate 500000 IU
7Sterile Noradrenaline Conc Inj 20mgSterile Noradrenaline Conc injSterile Noradrenaline Conc Inj 20mg
8Vancomycin Hcl 500mgVancomycin HclVancomycin Hcl 500mg
9Atracurium Besylate 50mgAtracurium BesylateAtracurium Besylate 50mg
10Omeprazole Injection 40mgOmeprazole InjectionOmeprazole Injection 40mg
11Sterile Noradrenaline Conc Inj 8mgSterile Noradrenaline ConcSterile Noradrenaline Conc Inj 20mg
12L-Asparaginase 10000IUDoxorubicin HclDoxorubicin Hcl 50mg
13Oxaliplatin 100mg
14Doxorubicin Hcl 50mg
15Cytarabine 500mg
Main
Cell Formulas
RangeFormula
D2:D12D2=VLOOKUP(C2&"*",$A$2:$A$15,1,0)
Hi fluff,

but I need the mapping in sheet1 with the mapping sheet.

sorry for the inconvenience as I was not specified earlier.
 
Upvote 0
In that case I have no idea what you are trying to do.
You will need to explain exactly what you are trying to do.
 
Upvote 0
Hi, see the linked file for a possible solution...
Wrong cells visible on Google Drive, because Google Drive does not know the FILTER function. The formula works correctly with your Office 365.

The formula used in the table...
=IFERROR(TEXTJOIN(", ",,FILTER(Medicines!A:A,LEFT(Medicines!A:A,LEN(A2))=A2)),"")

Medicines.xlsx

Medicines.png


Mapping.png
 
Upvote 0
Hi, I expanded the table with 3 columns.
(Wrong cells visible on Google Drive, because Google Drive does not know the FILTER function. The formula works correctly with your Office 365.)

The new formulas used in the new table...
B2: =IFERROR(IF(A2="","",TEXTJOIN(", ",,FILTER(Medicines!A:A,LEFT(Medicines!A:A,LEN(A2))=A2))),"")
C2: =IFERROR(IF(A2="","",COUNTA(FILTER(Medicines!A:A,LEFT(Medicines!A:A,LEN(A2))=A2))),"")
E2: =IFERROR(IF(OR(A2="",D2=0),"",INDEX(FILTER(Medicines!A:A,LEFT(Medicines!A:A,LEN(A2))=A2),D2)),"")

Medicines2.xlsx

Medicines2.png
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

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