Extract from string

  • Thread starter Thread starter mark
  • Start date Start date
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
 
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
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top