searching string for specific locations of words,space,ampersand in specific order

johnmerlino

Board Regular
Joined
Sep 21, 2010
Messages
94
Hey all,

I have two names like this:

PRIMEAU,I & PRIMEAU,JANETTE
BAIN ED & HELEN

which are similar but different than the following:

AVERNA,ROBERT C
Corn,Marlin
Lizand,ROBERT H
CATANESE,SALVATORE J & OLGA M
JIMENEZ,ALEJANDRO & HILDA M
Hernara,Harry & Marie Anne Martin
White,Alex & John M
Hernara,Marie Anne Martin
Hernara Martin,Harry & Marie Anne
Hernara -Martin,Harry & Marie Anne
Martin,Harry & Marie Anne Hernara
CORNWALL,A ROBERT & CORNWALL,ANNA
HernaraMartin,Harry & Marie Anne & Ann Sally
HernaraMartin,Harry & Marie & Ann Sally
HernaraMartin,Harry & Cortes,Ann
HernaraMartin,Harry & Smith,Marie Anne & Jenners,Ann Sally
Sarah Ann Little Junior
HernaraMartin,Harry & Marie,Anne & Ann Sally
KNUD J & MARIA L HOSTRUP
RAFIK RAYES & HODA TABAR

Basically, what makes the 2 instances different from the above list is the location of word(s),space, and how many word(s) before/after ampersand.

In essence, I am looking to create an if condition like below, which will only meet the criteria of first two instances:

If(character(s) then comma then character(s) then space then ampersand then space then character(s) then comma then character(s),IF(ISNUMBER(A1,FIND(","))),"a","b","")

IF(character(s) then space then character(s) then space then ampersand then space then character(s),IF(ISNUMBER(A1,FIND(","))),"a","b","")

Is it possible to create and if statement like the two above in Excel? Note I have very little VBA knowledge.

Thanks for response
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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