SOLVED

Cell to column and returning values

Copper Contributor

Does anyone have a formula that search a cell for a specific word and then returns the next 10-20 characters after the word including the word?

 

Ex. Bananas: Yellow. Apples: Green and Red. Lettuce: Green. Carrots: Orange. 

 

If that was in a cell can you search for Lettuce and return--  Lettuce: Green?

2 Replies
best response confirmed by Shaheen895 (Copper Contributor)
Solution

@Shaheen895 

Let's say the text "Bananas: Yellow. Apples: Green and Red. Lettuce: Green. Carrots: Orange." is in A1.

In B1, you enter Bananas, or Lettuce, or ...

Enter the following formula in C1:

=IFERROR(MID(A1,FIND(B1,A1),FIND(".",A1,FIND(B1,A1))-FIND(B1,A1)),"")
Awesome! Thanks!
1 best response

Accepted Solutions
best response confirmed by Shaheen895 (Copper Contributor)
Solution

@Shaheen895 

Let's say the text "Bananas: Yellow. Apples: Green and Red. Lettuce: Green. Carrots: Orange." is in A1.

In B1, you enter Bananas, or Lettuce, or ...

Enter the following formula in C1:

=IFERROR(MID(A1,FIND(B1,A1),FIND(".",A1,FIND(B1,A1))-FIND(B1,A1)),"")

View solution in original post