Find multiple text in a cell and return text and text location

Joined
Apr 30, 2009
Messages
3
Reaction score
0
I figured out how to search a cell for mutliple text and return the name of each found. I would also like to return the location of the text within the cell.

Example: I searched the text shown below for the words Wheat and Barley. Results returned were: Wheat, Barley,
WHEAT FLOUR, MALTED BARLEY FLOUR, NIACIN (A B VITAMIN), IRON, THIAMIN MONONITRATE (VITAMIN B1), RIBOFLAVIN (VITAMIN B2), FOLIC ACID(A B VITAMIN).
Is it possible to also return the locaiton of each word? - i.e.: Is it the 9th word -or- is it the 37th character in the cell? In this example WHEAT is the first word, or starts with the fist character. BARLEY is the 4th word, or starts with the 21st character.

Here is the formula I am currently using:
=IF(ISNUMBER(SEARCH("WHEAT",C14)),"WHEAT, ", "")&IF(ISNUMBER(SEARCH("Barley",C14)),"Barley, ", "")

Any help would be appreciated! Thanks.
 
I figured it out.

=IF(ISNUMBER(SEARCH("WHEAT",C11)),"WHEAT, ","")&FIND("WHEAT",$C11,1)&IF(ISNUMBER(SEARCH("BARLEY",C11))," ,BARLEY, ","")&FIND("BARLEY",$C11,1)
 
Back
Top