=TRIM(IF(NOT(ISERROR(SEARCH("SUPERTUNIA",H2,1))),"SUPERTUNIA",IF(NOT(ISERROR(SEARCH("BEGONIA",H2,1))),
"BEGONIA",IF(NOT(ISERROR(SEARCH("ALYSSUM",H2,1))),"ALYSSUM",IF(NOT(ISERROR(SEARCH("DIANTHUS",H2,1))),
"DIANTHUS",IF(NOT(ISERROR(SEARCH("EUSTOMA",H2,1))),"EUSTOMA",IF(NOT(ISERROR(SEARCH("RE-STOCK",H2,1))),"RESTOCK",IF(NOT(ISERROR(SEARCH("ROSEMARY",H2,1))),"ROSEMARY",IF(NOT(ISERROR(SEARCH("PROCESSING CHG.",H2,1))),"PROCESSING CHG.",IF(NOT(ISERROR(SEARCH("DELIVERY CHG.",H2,1))),"DELIVERY CHG.",IF(NOT(ISERROR(SEARCH("WEDELIA",H2,1))),"WEDELIA",IF(NOT(ISERROR(SEARCH
("KOPSIA",H2,1))),"KOPSIA",IF(NOT(ISERROR(SEARCH("MISCELLANEOUS",H2,1))),"MISC",IF(ISERROR(SEARCH("-",H2,1)),MID(H2,SEARCH(" ",H2,1)+1,SEARCH(" ",H2,SEARCH(" ",H2)+1)-SEARCH(" ",H2,1)),MID(H2,SEARCH(" ",H2,1)+1,SEARCH("-",H2,1)-SEARCH(" ",H2,1)-1)))))))))))))))
I use the above to pull out one word from an exported SQL Server accounting program file.
4" PANSY-ATLAS YELLOW becomes Pansy
1G CLERODENDRUM quadriloculare becomes Clerodendrum
and so on. I then use this to sort on a Pivot Table the amount of sales for a group of plants. My inventory person who enters the items isn't always consistent with his naming structure and before an error is caught, the item is sold and can't be changed.
The errors create #VALUE errors and fixed with the IFs. I have 418 unique plant groups with over 400,000 rows of data.
Any help is appreciated and if it takes the computer a few minutes to calculate this is ok with me.
Thanks for reading and any help is appreciated.
Lee
"BEGONIA",IF(NOT(ISERROR(SEARCH("ALYSSUM",H2,1))),"ALYSSUM",IF(NOT(ISERROR(SEARCH("DIANTHUS",H2,1))),
"DIANTHUS",IF(NOT(ISERROR(SEARCH("EUSTOMA",H2,1))),"EUSTOMA",IF(NOT(ISERROR(SEARCH("RE-STOCK",H2,1))),"RESTOCK",IF(NOT(ISERROR(SEARCH("ROSEMARY",H2,1))),"ROSEMARY",IF(NOT(ISERROR(SEARCH("PROCESSING CHG.",H2,1))),"PROCESSING CHG.",IF(NOT(ISERROR(SEARCH("DELIVERY CHG.",H2,1))),"DELIVERY CHG.",IF(NOT(ISERROR(SEARCH("WEDELIA",H2,1))),"WEDELIA",IF(NOT(ISERROR(SEARCH
("KOPSIA",H2,1))),"KOPSIA",IF(NOT(ISERROR(SEARCH("MISCELLANEOUS",H2,1))),"MISC",IF(ISERROR(SEARCH("-",H2,1)),MID(H2,SEARCH(" ",H2,1)+1,SEARCH(" ",H2,SEARCH(" ",H2)+1)-SEARCH(" ",H2,1)),MID(H2,SEARCH(" ",H2,1)+1,SEARCH("-",H2,1)-SEARCH(" ",H2,1)-1)))))))))))))))
I use the above to pull out one word from an exported SQL Server accounting program file.
4" PANSY-ATLAS YELLOW becomes Pansy
1G CLERODENDRUM quadriloculare becomes Clerodendrum
and so on. I then use this to sort on a Pivot Table the amount of sales for a group of plants. My inventory person who enters the items isn't always consistent with his naming structure and before an error is caught, the item is sold and can't be changed.
The errors create #VALUE errors and fixed with the IFs. I have 418 unique plant groups with over 400,000 rows of data.
Any help is appreciated and if it takes the computer a few minutes to calculate this is ok with me.
Thanks for reading and any help is appreciated.
Lee