Find multiple matches with wildcard search

roccoau

New Member
Joined
Dec 25, 2016
Messages
22
Office Version
  1. 365
Hi,

I would like to do a wildcard word search to find all matches for a word entered from a list of descriptions, and if there are multiple occurrences of this word, I would like all matches displayed.

I have a worksheet called "Main"

In column "A" I would like to add a wildcard word search. (In attached example, the word is "value.")

I would like this entered word to be searched in column "K2"

Whenever the word "value" is found, I would like the full description found in K2 for the wildcard word matched or multiple matches populated in column "B2" (each separate description found is to be separated by a comma between them)
I would also like the corresponding data in J2 for the match or matches to populate to C2 in same way as above

I have this formula in the attached example, but it does not cover all the above. =IFERROR(INDEX($K$2:$K$57,MATCH("*"&A2&"*",$K$2:$K$57,0))," ")

Hope someone can help
I am using excel 365

Book1.xlsx
ABCDEFGHIJK
1HS Code Description Wild card Description HS code description H.S CodeH.S CodeRaw materials
2ValveSafety Releif valves73041100Steel Pipe / Carbon Steel Pipe
3 73041900Seamless - Steel Pipe / Carbon Steel Seamless Pipe
4 73044100Stainless Steel Pipe
5 73044900Stainless Steel Pipe / SS Seamless Pipe
6 75071200Alloy Pipes
7 73053100Welded Pipe / Carbon Steel Welded Pipe
8 73061100Steel Welded Pipe
9 73064000SS Welded Pipe
10 73065000Alloy Welded Pipe
11 73072100Flanges / SS Flanges
12 73072300Pipe Fittings / Butt Weld Fittings
13 73079300Butt Weld Fittings / Alloy Pipe Fittings
14 73072900Pipe Fittings / SS Pipe Fittings/ SS & SDSS Forged Fittings
15 73079900Alloy Pipe Fittings
1683111000Welding Consumables / Electrodes / Filler Wires
1772071200Semi-finished Products Of Iron Or Non-alloy Steel
1872082500Steel Plates / Flat-Rolled Products of Iron & Non Alloy Steel, Not Clad
1972199000Steel Plates / Flat-Rolled Products of Stainless Steel / SS Plates
2072161000Steel U Beams / I Beams / H Beams / Angles, Shapes & Sections Of Iron & Nonalloy Steel
2172191100Stainless Steel Plates / Flat-Roll Stainless Steel Products, Not Und 600mm Wide
2272254000Alloy Steel Plates / Flat-Roll Alloy Steel Nesoi N/Un 600mm Wide
2373079100Flanges / Steel Flanges
2473045900Stainless Steel Pipes / Alloy Pipes / Alloy Welded Pipes
2573063000Carbon Steel Welded Pipe
2673061900Carbon Steel Seamless Pipe
2773Stainless Steel Seamless Pipe
2884814000Safety Releif valves
2984818030Valves / Gate Valves / Globe Valves / Ball Valves
3084841000Gaskets Valves
3173051200Steel Pipe / Line Pipe of a kind used for oil or Gas pipelines
3273129010Steel Wire Rope / Slings / Cables / Antitwist Wire Rope
3372126000Steel Clad Plates / Flat Roll Iron & Steel with SS Clad
3472251900Alloy Clad Plates/ Flat Roll Iron & Steel with SS Clad
3585161010Heaters / Heater Coils
3684818090Control Valves
3784148000Screw compressor
3885015300AC motors / Mullti-phase of an output > 750 kW
3985372000Switchgear
4084138190Oil pump
4185015200AC motors / multi-phase, of an output > 750 W but <= 37 kW
4284212300Oil Filters
4384813000Check Valves
4484818070Strainers / Filtration Units
4585363000Electric Distribution Boards / Junction Boxes
4684219900Oil Filter Elements
4784836000Couplings Valve
4834039900Lubricating Oil
4985371000Programmable Logic Controllers / P L C
5073141400Demister Pads
5184818060Filtration Units / Strainers
5290259000Thermowells / Temperature Measuring Instruments
5384879000AV Mount
5484212990Coalescer
5584195000Heat Exchanger Units
5685444991Flame Retardant Cable
5784199000Description as Spare Parts / Machine Parts
Main
Cell Formulas
RangeFormula
B2B2=IFERROR(INDEX($K$2:$K$57,MATCH("*"&A2&"*",$K$2:$K$57,0))," ")
B3:B15B3=IFERROR(INDEX(#REF!,MATCH("*"&A3&"*",#REF!,0))," ")
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Whenever the word "value" is found
Word or string? From your example, I assume you want a string search not a word search.

Anyway, options for each circumstance shown below.

24 02 18.xlsm
ABCDIJK
1HS Code Description Wild card Description HS code description H.S CodeH.S CodeRaw materials
2PipeSteel Pipe / Carbon Steel Pipe7304110073041100Steel Pipe / Carbon Steel Pipe
3Seamless - Steel Pipe / Carbon Steel Seamless Pipe7304190073041900Seamless - Steel Pipe / Carbon Steel Seamless Pipe
4Stainless Steel Pipe7304410073044100Stainless Steel Pipe
5Stainless Steel Pipe / SS Seamless Pipe7304490073044900Stainless Steel Pipe / SS Seamless Pipe
6Alloy Pipes7507120075071200Alloy Pipes
7Welded Pipe / Carbon Steel Welded Pipe7305310073053100Welded Pipe / Carbon Steel Welded Pipe
8Steel Welded Pipe7306110073061100Steel Welded Pipe
9SS Welded Pipe7306400073064000SS Welded Pipe
10Alloy Welded Pipe7306500073065000Alloy Welded Pipe
11Pipe Fittings / Butt Weld Fittings7307230073072100Flanges / SS Flanges
12Butt Weld Fittings / Alloy Pipe Fittings7307930073072300Pipe Fittings / Butt Weld Fittings
13Pipe Fittings / SS Pipe Fittings/ SS & SDSS Forged Fittings7307290073079300Butt Weld Fittings / Alloy Pipe Fittings
14Alloy Pipe Fittings7307990073072900Pipe Fittings / SS Pipe Fittings/ SS & SDSS Forged Fittings
15Stainless Steel Pipes / Alloy Pipes / Alloy Welded Pipes7304590073079900Alloy Pipe Fittings
16Carbon Steel Welded Pipe7306300083111000Welding Consumables / Electrodes / Filler Wires
17Carbon Steel Seamless Pipe7306190072071200Semi-finished Products Of Iron Or Non-alloy Steel
18Stainless Steel Seamless Pipe7372082500Steel Plates / Flat-Rolled Products of Iron & Non Alloy Steel, Not Clad
19Steel Pipe / Line Pipe of a kind used for oil or Gas pipelines7305120072199000Steel Plates / Flat-Rolled Products of Stainless Steel / SS Plates
2072161000Steel U Beams / I Beams / H Beams / Angles, Shapes & Sections Of Iron & Nonalloy Steel
2172191100Stainless Steel Plates / Flat-Roll Stainless Steel Products, Not Und 600mm Wide
2272254000Alloy Steel Plates / Flat-Roll Alloy Steel Nesoi N/Un 600mm Wide
2373079100Flanges / Steel Flanges
24Steel Pipe / Carbon Steel Pipe7304110073045900Stainless Steel Pipes / Alloy Pipes / Alloy Welded Pipes
25Seamless - Steel Pipe / Carbon Steel Seamless Pipe7304190073063000Carbon Steel Welded Pipe
26Stainless Steel Pipe7304410073061900Carbon Steel Seamless Pipe
27Stainless Steel Pipe / SS Seamless Pipe7304490073Stainless Steel Seamless Pipe
28Welded Pipe / Carbon Steel Welded Pipe7305310084814000Safety Releif valves
29Steel Welded Pipe7306110084818030Valves / Gate Valves / Globe Valves / Ball Valves
30SS Welded Pipe7306400084841000Gaskets Valves
31Alloy Welded Pipe7306500073051200Steel Pipe / Line Pipe of a kind used for oil or Gas pipelines
32Pipe Fittings / Butt Weld Fittings7307230073129010Steel Wire Rope / Slings / Cables / Antitwist Wire Rope
33Butt Weld Fittings / Alloy Pipe Fittings7307930072126000Steel Clad Plates / Flat Roll Iron & Steel with SS Clad
34Pipe Fittings / SS Pipe Fittings/ SS & SDSS Forged Fittings7307290072251900Alloy Clad Plates/ Flat Roll Iron & Steel with SS Clad
35Alloy Pipe Fittings7307990085161010Heaters / Heater Coils
36Carbon Steel Welded Pipe7306300084818090Control Valves
37Carbon Steel Seamless Pipe7306190084148000Screw compressor
38Stainless Steel Seamless Pipe7385015300AC motors / Mullti-phase of an output > 750 kW
39Steel Pipe / Line Pipe of a kind used for oil or Gas pipelines7305120085372000Switchgear
4084138190Oil pump
4185015200AC motors / multi-phase, of an output > 750 W but <= 37 kW
4284212300Oil Filters
4384813000Check Valves
4484818070Strainers / Filtration Units
4585363000Electric Distribution Boards / Junction Boxes
4684219900Oil Filter Elements
4784836000Couplings Valve
4834039900Lubricating Oil
4985371000Programmable Logic Controllers / P L C
5073141400Demister Pads
5184818060Filtration Units / Strainers
5290259000Thermowells / Temperature Measuring Instruments
5384879000AV Mount
5484212990Coalescer
5584195000Heat Exchanger Units
5685444991Flame Retardant Cable
5784199000Description as Spare Parts / Machine Parts
Search
Cell Formulas
RangeFormula
B2:C19B2=CHOOSECOLS(FILTER(J2:K57,ISNUMBER(SEARCH(A2,K2:K57)),{"",""}),2,1)
B24:C39B24=CHOOSECOLS(FILTER(J2:K57,ISNUMBER(SEARCH(" "&A2&" "," "&K2:K57&" ")),{"",""}),2,1)
Dynamic array formulas.
 
Upvote 0
I think OP is asking for comma separated in same cell.
This is what I come up with, but, I don't know how to return as an array. Any ideas?

Book1
ABCJK
1HS Code Description Wild card Description HS code description H.S CodeH.S CodeRaw materials
2AlloyAlloy Pipes, Alloy Welded Pipe, Butt Weld Fittings / Alloy Pipe Fittings, Alloy Pipe Fittings, Steel Plates / Flat-Rolled Products of Iron & Non Alloy Steel, Not Clad, Alloy Steel Plates / Flat-Roll Alloy Steel Nesoi N/Un 600mm Wide, Stainless Steel Pipes / Alloy Pipes / Alloy Welded Pipes, Alloy Clad Plates/ Flat Roll Iron & Steel with SS Clad75071200, 73065000, 73079300, 73079900, 72082500, 72254000, 73045900, 7225190073041100A
373041900Seamless - Steel Pipe / Carbon Steel Seamless Pipe
473044100Stainless Steel Pipe
573044900Stainless Steel Pipe / SS Seamless Pipe
675071200Alloy Pipes
773053100Welded Pipe / Carbon Steel Welded Pipe
873061100Steel Welded Pipe
973064000SS Welded Pipe
1073065000Alloy Welded Pipe
1173072100Flanges / SS Flanges
1273072300Pipe Fittings / Butt Weld Fittings
1373079300Butt Weld Fittings / Alloy Pipe Fittings
1473072900Pipe Fittings / SS Pipe Fittings/ SS & SDSS Forged Fittings
1573079900Alloy Pipe Fittings
1683111000Welding Consumables / Electrodes / Filler Wires
1772071200Semi-finished Products Of Iron Or Non-alloy Steel
1872082500Steel Plates / Flat-Rolled Products of Iron & Non Alloy Steel, Not Clad
1972199000Steel Plates / Flat-Rolled Products of Stainless Steel / SS Plates
2072161000Steel U Beams / I Beams / H Beams / Angles, Shapes & Sections Of Iron & Nonalloy Steel
2172191100Stainless Steel Plates / Flat-Roll Stainless Steel Products, Not Und 600mm Wide
2272254000Alloy Steel Plates / Flat-Roll Alloy Steel Nesoi N/Un 600mm Wide
2373079100Flanges / Steel Flanges
2473045900Stainless Steel Pipes / Alloy Pipes / Alloy Welded Pipes
2573063000Carbon Steel Welded Pipe
2673061900Carbon Steel Seamless Pipe
2773Stainless Steel Seamless Pipe
2884814000Safety Releif valves
2984818030Valves / Gate Valves / Globe Valves / Ball Valves
3084841000Gaskets Valves
3173051200Steel Pipe / Line Pipe of a kind used for oil or Gas pipelines
3273129010Steel Wire Rope / Slings / Cables / Antitwist Wire Rope
3372126000Steel Clad Plates / Flat Roll Iron & Steel with SS Clad
3472251900Alloy Clad Plates/ Flat Roll Iron & Steel with SS Clad
3585161010Heaters / Heater Coils
3684818090Control Valves
3784148000Screw compressor
3885015300AC motors / Mullti-phase of an output > 750 kW
3985372000Switchgear
4084138190Oil pump
4185015200AC motors / multi-phase, of an output > 750 W but <= 37 kW
4284212300Oil Filters
4384813000Check Valves
4484818070Strainers / Filtration Units
4585363000Electric Distribution Boards / Junction Boxes
4684219900Oil Filter Elements
4784836000Couplings Valve
4834039900Lubricating Oil
4985371000Programmable Logic Controllers / P L C
5073141400Demister Pads
5184818060Filtration Units / Strainers
5290259000Thermowells / Temperature Measuring Instruments
5384879000AV Mount
5484212990Coalescer
5584195000Heat Exchanger Units
5685444991Flame Retardant Cable
5784199000Description as Spare Parts / Machine Parts
Sheet2
Cell Formulas
RangeFormula
B2B2=TEXTJOIN(","&CHAR(10),,FILTER($K$2:$K$57,ISNUMBER(FIND($A$2,$K$2:$K$57))=TRUE,""))
C2C2=TEXTJOIN(","&CHAR(10),,FILTER($J$2:$J$57,ISNUMBER(FIND($A$2,$K$2:$K$57))=TRUE,""))
 
Upvote 0
Thanks all works perfect exactly what I was looking for
Since you marked post 3 it seems you did want all results in a single row, which I had missed. However, given your initial example I think that you might need SEARCH (not case-sensitive) rather than FIND (is case-sensitive) in the formulas. The post 3 results are missing the data from row 17 (contains "Non-alloy Steel") and row 20 (contains "Nonalloy Steel")

Also, if you want you can get both columns with a single formula

24 02 18.xlsm
ABCDIJK
1HS Code Description Wild card Description HS code description H.S CodeH.S CodeRaw materials
2AlloyAlloy Pipes, Alloy Welded Pipe, Butt Weld Fittings / Alloy Pipe Fittings, Alloy Pipe Fittings, Semi-finished Products Of Iron Or Non-alloy Steel, Steel Plates / Flat-Rolled Products of Iron & Non Alloy Steel, Not Clad, Steel U Beams / I Beams / H Beams / Angles, Shapes & Sections Of Iron & Nonalloy Steel, Alloy Steel Plates / Flat-Roll Alloy Steel Nesoi N/Un 600mm Wide, Stainless Steel Pipes / Alloy Pipes / Alloy Welded Pipes, Alloy Clad Plates/ Flat Roll Iron & Steel with SS Clad75071200, 73065000, 73079300, 73079900, 72071200, 72082500, 72161000, 72254000, 73045900, 7225190073041100Steel Pipe / Carbon Steel Pipe
373041900Seamless - Steel Pipe / Carbon Steel Seamless Pipe
473044100Stainless Steel Pipe
573044900Stainless Steel Pipe / SS Seamless Pipe
675071200Alloy Pipes
773053100Welded Pipe / Carbon Steel Welded Pipe
873061100Steel Welded Pipe
973064000SS Welded Pipe
1073065000Alloy Welded Pipe
1173072100Flanges / SS Flanges
1273072300Pipe Fittings / Butt Weld Fittings
1373079300Butt Weld Fittings / Alloy Pipe Fittings
1473072900Pipe Fittings / SS Pipe Fittings/ SS & SDSS Forged Fittings
1573079900Alloy Pipe Fittings
1683111000Welding Consumables / Electrodes / Filler Wires
1772071200Semi-finished Products Of Iron Or Non-alloy Steel
1872082500Steel Plates / Flat-Rolled Products of Iron & Non Alloy Steel, Not Clad
1972199000Steel Plates / Flat-Rolled Products of Stainless Steel / SS Plates
2072161000Steel U Beams / I Beams / H Beams / Angles, Shapes & Sections Of Iron & Nonalloy Steel
2172191100Stainless Steel Plates / Flat-Roll Stainless Steel Products, Not Und 600mm Wide
2272254000Alloy Steel Plates / Flat-Roll Alloy Steel Nesoi N/Un 600mm Wide
2373079100Flanges / Steel Flanges
2473045900Stainless Steel Pipes / Alloy Pipes / Alloy Welded Pipes
2573063000Carbon Steel Welded Pipe
2673061900Carbon Steel Seamless Pipe
2773Stainless Steel Seamless Pipe
2884814000Safety Releif valves
2984818030Valves / Gate Valves / Globe Valves / Ball Valves
3084841000Gaskets Valves
3173051200Steel Pipe / Line Pipe of a kind used for oil or Gas pipelines
3273129010Steel Wire Rope / Slings / Cables / Antitwist Wire Rope
3372126000Steel Clad Plates / Flat Roll Iron & Steel with SS Clad
3472251900Alloy Clad Plates/ Flat Roll Iron & Steel with SS Clad
3585161010Heaters / Heater Coils
3684818090Control Valves
3784148000Screw compressor
3885015300AC motors / Mullti-phase of an output > 750 kW
3985372000Switchgear
4084138190Oil pump
4185015200AC motors / multi-phase, of an output > 750 W but <= 37 kW
4284212300Oil Filters
4384813000Check Valves
4484818070Strainers / Filtration Units
4585363000Electric Distribution Boards / Junction Boxes
4684219900Oil Filter Elements
4784836000Couplings Valve
4834039900Lubricating Oil
4985371000Programmable Logic Controllers / P L C
5073141400Demister Pads
5184818060Filtration Units / Strainers
5290259000Thermowells / Temperature Measuring Instruments
5384879000AV Mount
5484212990Coalescer
5584195000Heat Exchanger Units
5685444991Flame Retardant Cable
5784199000Description as Spare Parts / Machine Parts
Search (2)
Cell Formulas
RangeFormula
B2:C2B2=LET(j,","&CHAR(10),f,FILTER(J2:K57,ISNUMBER(SEARCH(A2,K2:K57))),HSTACK(TEXTJOIN(j,,TAKE(f,,-1)),TEXTJOIN(j,,TAKE(f,,1))))
Dynamic array formulas.
 
Upvote 0
Solution
Since you marked post 3 it seems you did want all results in a single row, which I had missed. However, given your initial example I think that you might need SEARCH (not case-sensitive) rather than FIND (is case-sensitive) in the formulas. The post 3 results are missing the data from row 17 (contains "Non-alloy Steel") and row 20 (contains "Nonalloy Steel")

Also, if you want you can get both columns with a single formula

24 02 18.xlsm
ABCDIJK
1HS Code Description Wild card Description HS code description H.S CodeH.S CodeRaw materials
2AlloyAlloy Pipes, Alloy Welded Pipe, Butt Weld Fittings / Alloy Pipe Fittings, Alloy Pipe Fittings, Semi-finished Products Of Iron Or Non-alloy Steel, Steel Plates / Flat-Rolled Products of Iron & Non Alloy Steel, Not Clad, Steel U Beams / I Beams / H Beams / Angles, Shapes & Sections Of Iron & Nonalloy Steel, Alloy Steel Plates / Flat-Roll Alloy Steel Nesoi N/Un 600mm Wide, Stainless Steel Pipes / Alloy Pipes / Alloy Welded Pipes, Alloy Clad Plates/ Flat Roll Iron & Steel with SS Clad75071200, 73065000, 73079300, 73079900, 72071200, 72082500, 72161000, 72254000, 73045900, 7225190073041100Steel Pipe / Carbon Steel Pipe
373041900Seamless - Steel Pipe / Carbon Steel Seamless Pipe
473044100Stainless Steel Pipe
573044900Stainless Steel Pipe / SS Seamless Pipe
675071200Alloy Pipes
773053100Welded Pipe / Carbon Steel Welded Pipe
873061100Steel Welded Pipe
973064000SS Welded Pipe
1073065000Alloy Welded Pipe
1173072100Flanges / SS Flanges
1273072300Pipe Fittings / Butt Weld Fittings
1373079300Butt Weld Fittings / Alloy Pipe Fittings
1473072900Pipe Fittings / SS Pipe Fittings/ SS & SDSS Forged Fittings
1573079900Alloy Pipe Fittings
1683111000Welding Consumables / Electrodes / Filler Wires
1772071200Semi-finished Products Of Iron Or Non-alloy Steel
1872082500Steel Plates / Flat-Rolled Products of Iron & Non Alloy Steel, Not Clad
1972199000Steel Plates / Flat-Rolled Products of Stainless Steel / SS Plates
2072161000Steel U Beams / I Beams / H Beams / Angles, Shapes & Sections Of Iron & Nonalloy Steel
2172191100Stainless Steel Plates / Flat-Roll Stainless Steel Products, Not Und 600mm Wide
2272254000Alloy Steel Plates / Flat-Roll Alloy Steel Nesoi N/Un 600mm Wide
2373079100Flanges / Steel Flanges
2473045900Stainless Steel Pipes / Alloy Pipes / Alloy Welded Pipes
2573063000Carbon Steel Welded Pipe
2673061900Carbon Steel Seamless Pipe
2773Stainless Steel Seamless Pipe
2884814000Safety Releif valves
2984818030Valves / Gate Valves / Globe Valves / Ball Valves
3084841000Gaskets Valves
3173051200Steel Pipe / Line Pipe of a kind used for oil or Gas pipelines
3273129010Steel Wire Rope / Slings / Cables / Antitwist Wire Rope
3372126000Steel Clad Plates / Flat Roll Iron & Steel with SS Clad
3472251900Alloy Clad Plates/ Flat Roll Iron & Steel with SS Clad
3585161010Heaters / Heater Coils
3684818090Control Valves
3784148000Screw compressor
3885015300AC motors / Mullti-phase of an output > 750 kW
3985372000Switchgear
4084138190Oil pump
4185015200AC motors / multi-phase, of an output > 750 W but <= 37 kW
4284212300Oil Filters
4384813000Check Valves
4484818070Strainers / Filtration Units
4585363000Electric Distribution Boards / Junction Boxes
4684219900Oil Filter Elements
4784836000Couplings Valve
4834039900Lubricating Oil
4985371000Programmable Logic Controllers / P L C
5073141400Demister Pads
5184818060Filtration Units / Strainers
5290259000Thermowells / Temperature Measuring Instruments
5384879000AV Mount
5484212990Coalescer
5584195000Heat Exchanger Units
5685444991Flame Retardant Cable
5784199000Description as Spare Parts / Machine Parts
Search (2)
Cell Formulas
RangeFormula
B2:C2B2=LET(j,","&CHAR(10),f,FILTER(J2:K57,ISNUMBER(SEARCH(A2,K2:K57))),HSTACK(TEXTJOIN(j,,TAKE(f,,-1)),TEXTJOIN(j,,TAKE(f,,1))))
Dynamic array formulas.
Thank you, Peter your solution works perfect.
Thanks all for your help much appreciated
 
Upvote 0
You're welcome. Glad we could help. Thanks for the follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,215
Members
452,618
Latest member
Tam84

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