Conditional Formatting: How to Select All Cells Containing Specific Text in Google Sheets?

Let's say you want to search for "foobar" in the A1:B10 interval.

Use an IF formula with a condition based on =REGEXMATCH :

IF the beach contains "foobar", returns the cell, otherwise we do nothing. You can send the cell data but also coordinate with =ROW() and =COLUMN()

You want to test all the cells then I made a chart with ArrayFormula.

=ArrayFormula(if(REGEXMATCH(A1:B10;"foobar");A1:B10;))

Edit: this method is case sensitive, space sensitive, etc … try to use =TRIM or =LOWER