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

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

Forum statistics

Threads
1,215,419
Messages
6,124,796
Members
449,189
Latest member
kristinh

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