Extracting specific text from another cell.

D

Doug

I have a cell with multiple lines of text.
Example Cell "B" lists:
sales
finance
marketing
administration
etc.

I want to only pull the word finance. Some people may have it and others may
not. I'm looking to find who does.

Any help is appreciated. thanks in advance.
 
D

Doug

Without trying to sound stupid. I've used a formula to do this before.
Finding text is not a problem. But what I'm trying to achieve is, extract the
word finance any time it sees it and put it into another cell. If it doesn't
find it, it returns nothing. It's really more text in the cell, I just
created an example with some simple words.
 
J

jamescox

Nope, you're not sounding stupid.

Sounds like you need an IF statement that uses FIND to see if the
string you are looking for is in the cell you are looking at.

You will need the ISERROR function in the condition part of the IF
because FIND returns a #VALUE! error if the string you are looking for
isn't in the cell.

If you are looking for just one string - "Finance" for example, you can
just have the IF function return a value of "Finance" if FIND doesn't
generate an error.

If you are doing something a bit more complex you can put the string
you are looking for in a different cell and use that cell address (eg,
B4) as one of the parameters of the FIND (in the place of "Finance") and
use it again as what the IF statement returns if FIND doesn't generate
an error.

Note that FIND is case sensitive, so you are going to be working with
user inputs, you may want to look at using the UPPER function in the
FIND to make the string you are looking for and the string in the cell
you are looking at both all upper case...
 
D

Doug

James,

thanks for your help. I actually used the IF statement with a SEARCH
function and that worked. I won't lose my notes this time.

Thanks again!
Doug
 
Top