Searching for information and then returning that info.

cbarryb

New Member
Joined
Jun 1, 2012
Messages
34
Office Version
  1. 365
Platform
  1. Windows
  2. Web
Each day I get in a bank statement, and on there I need to search within the reference column for specific text in the form of invoice numbers. but to get around the fact the invoice numbers and letters are different, I want to make a table with these values in, but have wildcards in between the letters:

S*IW
S*PW
U*IW

<tbody>
</tbody>

And so on.

I use this formula to return anything from the Reference column that starts with a 10000 number, and then it returns the number that I need:

Code:
=MID(B2,SEARCH("10000?????",B2),10)

I can change the "10000?????" to a cell number (R$2) and use wildcards in the cell, typing them in manually for each instance, but I was wondering if there is a way to use that formula to use a table of possible searches, being able to use wildcards (*) or (?) to return the 1st instance of an invoice number from the Reference column.
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
=if(mid(b2,2,5)="10000",mid(b2,2,10),"")
 
Last edited:
Upvote 0
Or :

=IFERROR(MID(B2,SEARCH(10000,B2),10),"")
 
Upvote 0
Or :

=IFERROR(MID(B2,SEARCH(10000,B2),10),"")


Thanks for you response, but what I need is to be able to change the 10000 part to the table NAME or $I:$I of possible searches, and then return the value of what any of those possibilities could be, i.e in my table I have:

ABCDEFGHIJK
DateRefAmountAcc NoLedgerAccInv NoS*IW
01/01/2019SN1234IW 100001234$100100001234ME100001234SN1234IWS*IV
S*PW
U*IW
U*IV
U*PW

<tbody>
</tbody>

I want the formula in H2 to look at B2, using the table in column I for search terms, and then return the full result, starting with say S and ending with IW (SN1234IW) from B2.
 
Upvote 0

Forum statistics

Threads
1,214,563
Messages
6,120,248
Members
448,952
Latest member
kjurney

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