ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   If/Then by specific word (https://www.excelbanter.com/excel-discussion-misc-queries/152421-if-then-specific-word.html)

Supe

If/Then by specific word
 
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.

Toppers

If/Then by specific word
 
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.


Supe

If/Then by specific word
 
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.


Toppers

If/Then by specific word
 
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.


Toppers

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.



All times are GMT +1. The time now is 01:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com