Add a Wildcard to an index

Pignit1965

New Member
Joined
Mar 12, 2018
Messages
1
Hi All, Can I add a wildcard to and index.
I have a table of data from which I am calling back pricing from all instances from the given lookup, but it will only pull exact matches but I need it ad a wildcard..

i.e. I need to search for CH12-04268-(any character) but I have to state CH12-04268-AA to get a return.

I am currently using this formula
{=IF(ISERROR(INDEX('L316'!$F$1:$K$5998,SMALL(IF('L316'!$F$1:$F$5998=$B$2,ROW('L316'!$F$1:$K$5998)),ROW('L316'!1:1)),3)),"",INDEX('L316'!$F$1:$K$5998,SMALL(IF('L316'!$F$1:$F$5998=$B$2,ROW('L316'!$F$1:$K$5998)),ROW('L316'!1:1)),3))}

Can I add wildcard to this or is there an easier or better way

Many thanks all
 
Try the following formula, which needs to be confirmed with CONTROL+SHIFT+ENTER...

=IF(ISERROR(INDEX('L316'!$F$1:$K$5999,SMALL(IF(LEFT('L316'!$F$1:$F$5999,LEN($B$2))=$B$2,ROW('L316'!$F$1:$K$5999)),ROW('L316'!1:1)),3)),"",INDEX('L316'!$F$1:$K$5999,SMALL(IF(LEFT('L316'!$F$1:$F$5999,LEN($B$2))=$B$2,ROW('L316'!$F$1:$K$5999)),ROW('L316'!1:1)),3))

...where B2 contains CH12-04268. Note, however, IFERROR can be used instead of ISERROR to trap errors. Also, the formula can be made to be more robust. So, for example, let's say that B2 contains CH12-04268 and that the formula will be entered in C2, and copied down. Try..

=IFERROR(INDEX('L316'!$F$1:$K$5999,SMALL(IF(LEFT('L316'!$F$1:$F$5999,LEN($B$2))=$B$2,ROW('L316'!$F$1:$K$5999)-ROW('L316'!$F$1)+1),ROWS($C$2:C2)),3),"")

Hope this helps!
 
Upvote 0

Forum statistics

Threads
1,226,771
Messages
6,192,926
Members
453,767
Latest member
922aloose

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