Wildcards Lookup

Biz

Well-known Member
Joined
May 18, 2009
Messages
1,773
Office Version
  1. 2021
Platform
  1. Windows
Hi,

I'm trying to lookup codes and return Desc_Type using vlookups with wildcards.
In Col B I have created formula which works compared to column C.

I was wondering if there a better way to approach this problem.

Excel Formula to Categorise Items.xlsx
ABCDEFGHIJKLMN
1CodeDesc_Type
2CodeFormulaDesc_TypeMatch1Construction
31ConstructionConstructionTRUEA0101Fees
4A0101FeesFeesTRUEA201Construction
5A201ConstructionConstructionTRUEA301Construction Contingency
6A301Construction ContingencyConstruction ContingencyTRUECConstruction
7C0101ConstructionConstructionTRUEC201Construction Contingency
8C0199ConstructionConstructionTRUEDFees
9C101ConstructionConstructionTRUEEFFE
10C101ConstructionConstructionTRUEHFees
11C102ConstructionConstructionTRUEKFees
12C201Construction ContingencyConstruction ContingencyTRUEP0101Programme Contingency
13C301ConstructionConstructionTRUER0101Construction
14C401ConstructionConstructionTRUETFees
15C501ConstructionConstructionTRUEY101Programme Contingency
16E101FFEFFETRUEY201Escalation
17E102FFEFFETRUEZFees
18D0101FeesFeesTRUE
19D101FeesFeesTRUE
20D103FeesFeesTRUE
21H0101FeesFeesTRUE
22K101FeesFeesTRUE
23P0101Programme ContingencyProgramme ContingencyTRUE
24R0101ConstructionConstructionTRUE
25R0101ConstructionConstructionTRUE
26T101FeesFeesTRUE
27Y101Programme ContingencyProgramme ContingencyTRUE
28Y102Programme ContingencyProgramme ContingencyTRUE
29Y102Programme ContingencyProgramme ContingencyTRUE
30Y103Programme ContingencyProgramme ContingencyTRUE
31Y201EscalationEscalationTRUE
32Y202EscalationEscalationTRUE
33Y203EscalationEscalationTRUE
34Y204EscalationEscalationTRUE
35Z0101FeesFeesTRUE
Trial 4
Cell Formulas
RangeFormula
B3:B35B3=IF(LEN(A3)=1,VLOOKUP(A3+0,$M$2:$N$17,2,0),IF(NOT(ISERROR(VLOOKUP(LEFT(A3,2)&"*",$M$2:$N$17,2,0))),VLOOKUP(LEFT(A3,2)&"*",$M$2:$N$17,2,0),VLOOKUP(LEFT(A3,1)&"*",$M$2:$N$17,2,0)))
D3:D35D3=B3=C3


Your help would be greatly appreciated.

Biz
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
You can simplify that formula like
Excel Formula:
=IF(LEN(A3)=1,VLOOKUP(A3+0,$M$2:$N$17,2,0),IFERROR(VLOOKUP(LEFT(A3,2)&"*",$M$2:$N$17,2,0),VLOOKUP(LEFT(A3,1)&"*",$M$2:$N$17,2,0)))
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,385
Messages
6,119,205
Members
448,874
Latest member
Lancelots

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