text filtering formula???

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
Is the name always at the end of the line of text? If so use something
like:

=MID(A1,FIND("is ",A1,1)+3,255)

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

(e-mail address removed)
Replace @mailinator.com with @tiscali.co.uk
 
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?

It's not clear what you are trying to do.

If you are trying to determine if some particular name is in a string, then,
with the name you are looking for in F1, and your line of text in A1, you could
use the following formula:

=IF(ISERR(FIND($F$1,A1)),"",$F$1)

If you are trying to see if any name from a list of names is in the line of
text, then you could use the **array-entered** formula:

=INDEX(NameList,MATCH(FALSE,ISERR(FIND(NameList,A1)),0))

To **array-enter** a formula, hold down <ctrl><shift> while hitting <enter>.
Excel will place braces {...} around the formula.

If the name is not present, the second formula will return a #N/A error. If
that is not suitable, you could trap it by nesting the formula in an IF
statement:

e.g.

=IF(ISNA(formula),"Name Not Present", formula)


--ron
 
Back
Top