Ever found yourself poring over spreadsheets, manually checking if cells contain specific text? It's time-consuming and prone to errors. Excel's Conditional Formatting can automate this task, and with a simple trick, you can check if a cell contains text from a list. Let's dive into this time-saving technique.

Imagine you have a list of fruits (Apple, Banana, Cherry) and you want to highlight cells in a column that contain any of these fruits. Instead of manually checking each cell, you can use Conditional Formatting to do this for you. Here's how:

Preparing Your List
Before we start, ensure your list of texts is in a separate range. For this example, let's assume your list is in cells A1:A3 (Apple, Banana, Cherry).

Now, let's proceed with the Conditional Formatting rule.
Using COUNTIF Function

The COUNTIF function counts the number of cells in a range that meet a given criterion. In our case, we'll use it to check if the cell's text is in our list.
Here's the formula you'll use: `=COUNTIF($A$1:$A$3, G2)>0` where G2 is the cell you want to check. This formula checks if any cell in the range A1:A3 (our list) is equal to the value in cell G2.
Applying the Conditional Formatting Rule

Now, let's apply this rule to our cells:
- Select the cells you want to apply the rule to.
- Click on 'Conditional Formatting' in the 'Home' tab, then 'New Rule'.
- Select 'Use a formula to determine which cells to format'.
- In the 'Format values where this formula is true:' box, enter our COUNTIF formula.
- Choose the formatting you want to apply (like fill color), then click 'OK'.
Applying the Rule to Entire Columns or Rows

What if you want to apply this rule to an entire column or row? You can do this by adjusting the range in your COUNTIF formula. For example, to apply the rule to column G, change the formula to `=COUNTIF($A$1:$A$3, G1)>0`.
This way, the rule will apply to all cells in column G, not just G2.



















Adjusting the Rule for New Data
If you add new data to your list, you'll need to adjust the range in your COUNTIF formula. To avoid this, you can use structured references (like A:A) in your formula. This way, the rule will automatically adjust to new data.
Here's how you can modify your formula: `=COUNTIF(A:A, G2)>0`
And there you have it! You've now learned how to use Conditional Formatting to check if a cell contains text from a list. This technique can save you time and reduce errors in your data analysis. Happy formatting!