Search code examples
arraysregexgoogle-sheetsgoogle-sheets-formulags-conditional-formatting

Mark cells that contain words from a FILTER list


I have a list of words in a basket which I want to pre-select through a FILTER list and color code the words in the basket which appear in the FILTER sheet. The challenge is, that the words in the basket have not the same word, but rather contain it. Here an example >

FILTER:

+--------+
| Apple  |
+--------+
| Banana |
+--------+

Basket:

+--------------+---+
| Apple//Cake  | x |
+--------------+---+
| Water        |   |
+--------------+---+
| Coke bottle  |   |
+--------------+---+
| Banana split | x |
+--------------+---+

Solution

  • use:

    =(A2<>"")*(INDEX(REGEXMATCH(LOWER(A2), 
     TEXTJOIN("|", 1, LOWER(INDIRECT("FILTER!A:A"))))))
    

    0