Forum Discussion

Shaheen895's avatar
Shaheen895
Copper Contributor
Jul 26, 2021
Solved

Cell to column and returning values

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?

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

2 Replies

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