If/Then by specific word

G

Guest

Is there a way to do an IF statement where if a specific word is in a
multiple word description, I could put that word in a different column. I
have hundreds of item descriptions for a nut category and would like to
create a TYPE column for the different types of nuts.

For example, if the descriptions was PL PEANUT NUT SNACK, then the word
PEANUT would go in the type column in that row. Or if PL ALMOND NUT SNACK
was the description, then ALMOND would go in that column.

Was thinking of an If/Then statement, but don't know how to tell it to look
for that specifice word in the cell.
 
G

Guest

If they are ALL formatted as your example i.e. start with "PL " then try:

=IF(ISNUMBER(SEARCH(" nut ",A1)),TRIM(MID(A1,3,SEARCH(" nut ",A1)-3)),"")
 
G

Guest

Unfortunately they are not. The first word is usually the vendor name so
there are going to be several different beginnings.
 
G

Guest

So what is a general format?

"vendor-text type-of-nut NUT moretext" ?

Does type-of-nut always precede the word NUT?
 
G

Guest

try:

=IF(ISNUMBER(SEARCH(" nut ",A1)),TRIM(MID(A1,FIND(" ",A1),SEARCH(" nut
",A1)-SEARCH(" ",A1))))
 

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

Top