View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Toppers Toppers is offline
external usenet poster
 
Posts: 4,339
Default If/Then by specific word

try:

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

"Toppers" wrote:

So what is a general format?

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

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

"Supe" wrote:

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



"Toppers" wrote:

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)),"")

"Supe" wrote:

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.