Finding strings using only first characters

lvisesteban

New Member
Joined
Oct 13, 2016
Messages
1
Hi everyone,

Im facing some issues with the find/search function.

I have a example matrix

[TABLE="width: 87"]
<!--StartFragment--> <colgroup><col width="87" style="width:65pt"> </colgroup><tbody>[TR]
[TD="width: 87"]21650094-6[/TD]
[/TR]
[TR]
[TD]21650065-7[/TD]
[/TR]
[TR]
[TD]23730130-7[/TD]
[/TR]
[TR]
[TD]21436620-7[/TD]
[/TR]
[TR]
[TD]21724110-3[/TD]
[/TR]
[TR]
[TD]22852562-6[/TD]
[/TR]
[TR]
[TD]5792980-4[/TD]
[/TR]
[TR]
[TD]11215394-2[/TD]
[/TR]
[TR]
[TD]14993992-k[/TD]
[/TR]
[TR]
[TD]10812158-0[/TD]
[/TR]
<!--EndFragment--></tbody>[/TABLE]


and a search field where users read with a barcode pistol, but barcode are like "21650094ANF-8", this code it's similar to the first one on the list, but only the first part "21650094" and then the barcode have random characters. But I still need to find the first result. Or maybe if I only insert "216500" it could return to posibilites from the matrix (the first and the second one)

I tried using =SEARCH(LEFT(A1,6),MATRIX)

but got formula error, any suggestions? :)

thanks in advance
 
Assuming data list is in column A and search value in B1

in C1
=IFERROR(INDEX($A$1:$A$100,SMALL(IF(ISNUMBER(SEARCH(B$1,A$1:A$100)),ROW($A$1:$A$100)),ROW(A1)),1),"")
Array formula, use Ctrl-Shift-Enter

and copy down column C
 
Upvote 0

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