Extract Specific Text

Extract_Text

https://exceljet.net/formula/if-cell-contains

If you want to copy cells that contain certain text, you can use a formula that uses the IF function together with the SEARCH and ISNUMBER functions. Once you find a value you’re looking for you can copy it to another location, or display a message, or perform some other calculation.

If cell contains “abc”, copy it elsewhere

In the example shown, we have a list of email addresses, and we want to copy those that contain “abc”. In  C5, the formula were using is this:

=IF(ISNUMBER(SEARCH("abc",B5)),B5,"")

In this formula, the logical test is this bit:

ISNUMBER(SEARCH("abc",B5))

This will return TRUE if the the value in B5 contains “abc” and false if not. See the cell contains specific text formula for a full explanation.

To copy cell B5 if TRUE, we just need to supply B5 again for the “value if true” argument. If false, we supply an empty string (“”) which will display as a blank cell on the worksheet.