Vlookup with wildcards in the "table_array"

Arul.rajesh

Active Member
Joined
Sep 20, 2011
Messages
285
Sorry if the title misguided you.


From a list of values in column "A" need to identify the values which begin with a certain string of characters listed here

CK
Credit Card
FRM
Xfer
Visa/Master
Transf
Trnsf


The data in column A looks like

AMERIHEALTH MANUAL P
AMERIHEALTH PAYMENT
CK 105
CK 1466
CK 2834
CK 323
CK 3255
CK 703
CK 7171
CK 828
CR CARD PAYMENT AMER
DELTA DENTAL
DUPLICATE POSTING
FRM ACCT 13470724
FRM ACCT 13485586
GHI PAYMENT
HEALTH PARTNERS
INCIDENTAL ONLY CHGS
MCAID GOVT PAYMENT M
ST CLOUD HLTHCARE CT
ST MARYS LIFE CENTER
TRANSFER FROM 259826
VISA/MASTER CHARGE
XFER FROM 260482430
XFER TO 8012197599



The ones beginning with the any of the strings listed above must be identified by a formula in column B.


This array formula works but is there a more elegant solution?

{=IF(SUM(N(IFERROR(SEARCH($E$1:$E$7,A1),0)))=1,"exclude","include")}


Assuming the first list of values is in $E$1:$E$7.
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Hi Arul

I think you have a good solution but this is another option:

=IF(SUM(COUNTIF(A1,$E$1:$E$7&"*")),"exclude","include")

confirmed with CSE
 
Upvote 0
I need to exclude them from the data I have. There are other columns in addition to the data in column A.
 
Upvote 0
Thanks pgc01

That eliminates some nested functions.

Non zero numbers evaluate to 1, keep forgetting to remember that.
 
Upvote 0
I want to create a list on another column in the same sheet say column B. then filter and remove the matches.

Hi

In that case you can use the Advanced Filter with the option Copy to another location. It will create the list directly.
 
Upvote 0
Hi

In that case you can use the Advanced Filter with the option Copy to another location. It will create the list directly.

I have to identify the values in column "A" first, for which the formula is needed.

Is there a way in advanced filter to do pattern matching?
 
Upvote 0

Forum statistics

Threads
1,214,642
Messages
6,120,700
Members
448,979
Latest member
DET4492

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