Streamlining your Excel workflow often involves automating repetitive tasks, and conditional formatting is a powerful tool for this. One of its many applications is checking if a cell contains text from a predefined list. This not only saves time but also enhances the visual appeal of your spreadsheets. Let's delve into how you can achieve this.

Before we dive into the steps, let's understand why you might want to do this. Suppose you have a list of product names in Column A, and you want to highlight the cells that contain 'Product A', 'Product B', or 'Product C'. Instead of manually checking each cell, you can use conditional formatting to automatically highlight the cells that meet your criteria.

Setting Up Your List
First, ensure your list of texts is in a separate range. For this example, let's assume your list is in cells B1:B5 (B1 contains 'Product A', B2 contains 'Product B', and so on).

It's crucial to have your list in a separate range because Excel's conditional formatting feature requires a range to compare against. You can't directly input a list of texts into the 'Use a formula to determine which cells to format' field.
Using the COUNTIF Function

The COUNTIF function is your friend here. It counts the number of cells in a range that meet a given criteria. In our case, we want to count how many times a cell in Column A appears in our list in Column B.
Here's the formula you'll use: `=COUNTIF($B$1:$B$5, A2)>0`. This formula checks if any of the cells in B1:B5 match the content of cell A2. If there's a match, it returns 1; if not, it returns 0.
Applying the Conditional Formatting

Now, let's apply this formula to our data. Select the range you want to apply the formatting to (in this case, A2:A100), then click on 'Conditional Formatting' in the 'Home' tab, and select 'New Rule...'.
In the 'New Formatting Rule' dialog box, select 'Use a formula to determine which cells to format', and enter our formula: `=COUNTIF($B$1:$B$5, A2)>0`. Choose the formatting you want to apply (like filling the cell with a color), and click 'OK'.
Expanding the Application

You're not limited to just highlighting cells. You can also use this technique to change the font color, apply borders, or even display an icon based on whether a cell's content is in your list.
Moreover, you can use this method to check if a cell contains any of the texts in your list, or all of them. For 'any of them', use the COUNTIF function as shown above. For 'all of them', use the COUNTIF function in an IF statement, like this: `=IF(COUNTIF($B$1:$B$5, A2)>4, TRUE, FALSE)`. This will return TRUE (and apply your formatting) only if all the texts in your list are present in the cell.



















Managing Large Lists
If your list is too large to fit in a single column, you can use the INDEX and MATCH functions together to create a virtual list. This allows you to use a large, multi-column list without having to physically create it in your spreadsheet.
For example, let's say your list is in cells C1:E100. You can use the formula `=INDEX(C1:E100, MATCH(A2, C1:E100, 0))` to create a virtual list in a single column. You can then use this virtual list in your conditional formatting formula.
In conclusion, using Excel's conditional formatting to check if a cell contains text from a list can greatly enhance your productivity. It's a powerful tool that, once mastered, can automate many repetitive tasks, freeing up your time to focus on more complex aspects of your work. So, go ahead and give it a try in your next project!