Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default sounds easy but I can't figure it out.....

I'm trying to find a formula to search for specific words in a line of text
and show the found word in a single cell.

For example the formula would search for "Joe" and "Mary" and "Steve" in a
single line of text. The text, to be filtered, might be as follows (The
students name is Mary.) The result of the search would have found "Mary" and
now show "Mary" in the cell. If the text to be filtered would have said (The
students name is Steve) the cell would show "Steve".

Does anyone know how to do what I'm trying to do?
Garth
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default sounds easy but I can't figure it out.....

Hi Garth,

With the string to search in A1, on one line -

=IF(ISERROR(FIND("Joe",A1)),IF(ISERROR(FIND("Mary" ,A1)),IF(ISERROR(FIND("Ste
ve",A1)),"not found","Steve"),"text Mary"),"text Joe")

Probably easier to put "Text " in another cell, say A2, and refer to it
....,A2 & "Joe")

Regards,
Peter T


"Garth the detailer" wrote in
message ...
I'm trying to find a formula to search for specific words in a line of

text
and show the found word in a single cell.

For example the formula would search for "Joe" and "Mary" and "Steve" in a
single line of text. The text, to be filtered, might be as follows (The
students name is Mary.) The result of the search would have found "Mary"

and
now show "Mary" in the cell. If the text to be filtered would have said

(The
students name is Steve) the cell would show "Steve".

Does anyone know how to do what I'm trying to do?
Garth



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default sounds easy but I can't figure it out.....

I think this is going to work, thanks much.

"Peter T" wrote:

Hi Garth,

With the string to search in A1, on one line -

=IF(ISERROR(FIND("Joe",A1)),IF(ISERROR(FIND("Mary" ,A1)),IF(ISERROR(FIND("Ste
ve",A1)),"not found","Steve"),"text Mary"),"text Joe")

Probably easier to put "Text " in another cell, say A2, and refer to it
....,A2 & "Joe")

Regards,
Peter T


"Garth the detailer" wrote in
message ...
I'm trying to find a formula to search for specific words in a line of

text
and show the found word in a single cell.

For example the formula would search for "Joe" and "Mary" and "Steve" in a
single line of text. The text, to be filtered, might be as follows (The
students name is Mary.) The result of the search would have found "Mary"

and
now show "Mary" in the cell. If the text to be filtered would have said

(The
students name is Steve) the cell would show "Steve".

Does anyone know how to do what I'm trying to do?
Garth




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default sounds easy but I can't figure it out.....

Peter, that worked like a charm. The only thing I question is if I add a
seventh name to be found in the formula an error pops up. It works great for
the first six names but seven is a no go. Is there a limit to how many names
I can search for?

forever grateul
Garth

"Peter T" wrote:

Hi Garth,

With the string to search in A1, on one line -

=IF(ISERROR(FIND("Joe",A1)),IF(ISERROR(FIND("Mary" ,A1)),IF(ISERROR(FIND("Ste
ve",A1)),"not found","Steve"),"text Mary"),"text Joe")

Probably easier to put "Text " in another cell, say A2, and refer to it
....,A2 & "Joe")

Regards,
Peter T


"Garth the detailer" wrote in
message ...
I'm trying to find a formula to search for specific words in a line of

text
and show the found word in a single cell.

For example the formula would search for "Joe" and "Mary" and "Steve" in a
single line of text. The text, to be filtered, might be as follows (The
students name is Mary.) The result of the search would have found "Mary"

and
now show "Mary" in the cell. If the text to be filtered would have said

(The
students name is Steve) the cell would show "Steve".

Does anyone know how to do what I'm trying to do?
Garth




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default sounds easy but I can't figure it out.....

I see Ron Ronsenfeld has already posted an excellent suggestion in your to
other thread. Adapting his formula slightly, try -

=A2 & INDEX(namelist,MATCH(FALSE,ISERR(FIND(namelist,A1) ),0))

Array entered

A1 - the search string
A2 - the text that prefixes the find result
namelist - a ref or named range of your find strings, Joe, Mary, Steve, etc

I'm pleased Ron flagged your other thread. Otherwise I would have spent a
lot of time trying to find a solution, probably ending up with a statement
about 7 nested If's and/or formula too long.

Regards,
Peter T




"Garth" wrote in message
...
Peter, that worked like a charm. The only thing I question is if I add a
seventh name to be found in the formula an error pops up. It works great

for
the first six names but seven is a no go. Is there a limit to how many

names
I can search for?

forever grateul
Garth

"Peter T" wrote:

Hi Garth,

With the string to search in A1, on one line -


=IF(ISERROR(FIND("Joe",A1)),IF(ISERROR(FIND("Mary" ,A1)),IF(ISERROR(FIND("Ste
ve",A1)),"not found","Steve"),"text Mary"),"text Joe")

Probably easier to put "Text " in another cell, say A2, and refer to it
....,A2 & "Joe")

Regards,
Peter T


"Garth the detailer" wrote

in
message ...
I'm trying to find a formula to search for specific words in a line of

text
and show the found word in a single cell.

For example the formula would search for "Joe" and "Mary" and "Steve"

in a
single line of text. The text, to be filtered, might be as follows

(The
students name is Mary.) The result of the search would have found

"Mary"
and
now show "Mary" in the cell. If the text to be filtered would have

said
(The
students name is Steve) the cell would show "Steve".

Does anyone know how to do what I'm trying to do?
Garth








  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default sounds easy but I can't figure it out.....

On Mon, 13 Aug 2007 13:22:03 -0700, Garth the detailer
wrote:

I'm trying to find a formula to search for specific words in a line of text
and show the found word in a single cell.

For example the formula would search for "Joe" and "Mary" and "Steve" in a
single line of text. The text, to be filtered, might be as follows (The
students name is Mary.) The result of the search would have found "Mary" and
now show "Mary" in the cell. If the text to be filtered would have said (The
students name is Steve) the cell would show "Steve".

Does anyone know how to do what I'm trying to do?
Garth


See another answer in .misc

Please don't multipost.
--ron
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change Format from Number to Percentage (sounds easy enough) Mike C Excel Worksheet Functions 2 October 12th 07 01:06 PM
Easy Problem that I can't figure out Cory from Eugene[_2_] Excel Discussion (Misc queries) 2 September 3rd 07 02:37 AM
UDFs needed I think they're pretty easy but I can't figure them ou Still Learning Excel Programming 2 September 22nd 06 04:51 PM
Help Please. How to save multiple html files (sounds easy but scenario causing confli sam76210[_3_] Excel Programming 0 March 24th 06 05:00 PM
Maybe an easy If / Then statement? But I can't figure it out. Help! Dave Peterson[_3_] Excel Programming 1 January 27th 04 03:22 AM


All times are GMT +1. The time now is 07:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"