Extract from string

M

mark

Hi All,
I want to be able to extract some text from various strings and place
it in the cell(s) to the right.
I'm looking for combinations of Ad or Con or both Ad and Con
similar to the following examples say in F3
"Wants Ad,Die" or "Wants Con,Die"
I want to be able to extract out the Ad or Con and place into G3
for Ad or H3 for Con

"Wants Ad,Con,Die"
I want to be able to extract out Ad,Con and place into I3

With this I'll be able to see who wants Ad only, Con only and Ad and
Con combined.
Some of the strings do not have Ad or Con at all.

Thank you
Mark
 
N

Niek Otten

Hi Mark,

In G3:
=IF(I3="",IF(ISERROR(FIND("ad",F3)),"","ad"),"")
In H3:
=IF(I3="",IF(ISERROR(FIND("con",F3)),"","con"),"")
In I3:
=IF(OR(ISERROR(FIND("ad",F3)),ISERROR(FIND("con",F3))),"","ad, con")

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

| Hi All,
| I want to be able to extract some text from various strings and place
| it in the cell(s) to the right.
| I'm looking for combinations of Ad or Con or both Ad and Con
| similar to the following examples say in F3
| "Wants Ad,Die" or "Wants Con,Die"
| I want to be able to extract out the Ad or Con and place into G3
| for Ad or H3 for Con
|
| "Wants Ad,Con,Die"
| I want to be able to extract out Ad,Con and place into I3
|
| With this I'll be able to see who wants Ad only, Con only and Ad and
| Con combined.
| Some of the strings do not have Ad or Con at all.
|
| Thank you
| Mark
|
 
Top