How To Extract All Text Strings After A Specific Text String In Microsoft Excel

In this article, you will learn how to extract all text strings after a specific text.

If there is a requirement to retrieve the data from a column after a specific text, we can use a combination of TRIM, MID, SEARCH, LEN functions to get the output.

 

Let us understand with an example:

 

  • We have text in column A, and in column B, we want to get the result & cell D2 contains the criteria or lookup text. Refer below snapshot

img1

 

  • Let us enter word “powerful” in Criteria Text cell D2
  • The formula in cell B2 would be =TRIM(MID(A2,SEARCH($D$2,A2)+LEN($D$2),255))

 
img2

 

  • If we change the Criteria Text say “tool” then, following will be the result (as shown in below screenshot):

img3

In this way, you can get the text strings after a specific text string.

Comments

    • Hey Neil,

      Its an interesting question, Let's assume,word be in A3 cell , specific text be in D2 cell. You need extract n characters after the Criteria Text. Use this formula =TRIM(MID(A3,SEARCH(D2,A3)+(n+LEN(D2)),255)). In your case Just replace the n with 8.
      Learn more about LEFT funtion. https://www.exceltip.com/working-with-formulas/left-function-in-microsoft-excel.html
      =TRIM(MID(A3,SEARCH(D2,A3)+(n+LEN(D2)),255))

    • Use this formula
      =LEFT(text,FIND("specific character")-1)
      Learn more about LEFT funtion. https://www.exceltip.com/working-with-formulas/left-function-in-microsoft-excel.html

  1. Thank you! I have been looking for this for the longest time. Flash fill was making errors, so this will help to completely resolve those issues.

Leave a Reply

Your email address will not be published. Required fields are marked *

Terms and Conditions of use

The applications/code on this site are distributed as is and without warranties or liability. In no event shall the owner of the copyrights, or the authors of the applications/code be liable for any loss of profit, any problems or any damage resulting from the use or evaluation of the applications/code.