One solution is a formula that uses the IF function together with the SEARCH and ISNUMBER functions. In the example shown, we have a list of email addresses, and we want to extract those that contain “abc”. In  C5, the formula were using is this: If “abc” is found anywhere in cell B5, IF will return that value. If not, IF will return an empty string (""). In this formula, the logical test is this bit: This snippet will return TRUE if the the value in B5 contains “abc” and false if not. The logic of ISNUMBER + SEARCH is explained in detail here.  To copy cell the value in B5 when it contains “abc”, we provide 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.

Dave Bruns

Hi - I’m Dave Bruns, and I run Exceljet with my wife, Lisa. Our goal is to help you work faster in Excel. We create short videos, and clear examples of formulas, functions, pivot tables, conditional formatting, and charts.