Conditional Formatting: Highlight Cells Containing Text from a List

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.

Excel Conditional Formatting If a Cell Contains Any Text
Excel Conditional Formatting If a Cell Contains Any Text

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:

Excel Conditional Formatting Based on Another Cell Tutorial
Excel Conditional Formatting Based on Another Cell Tutorial

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).

How to Copy Conditional Formatting to Another Cell in Excel
How to Copy Conditional Formatting to Another Cell in Excel

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

Using COUNTIF Function

How to Do Conditional Formatting Based on Another Cell in Excel (6 Easy Ways) - ExcelDemy
How to Do Conditional Formatting Based on Another Cell in Excel (6 Easy Ways) - ExcelDemy

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

Conditionally format a cell which has part of its text match any value from a range of cells in a specific column
Conditionally format a cell which has part of its text match any value from a range of cells in a specific column

Now, let's apply this rule to our cells:

  1. Select the cells you want to apply the rule to.
  2. Click on 'Conditional Formatting' in the 'Home' tab, then 'New Rule'.
  3. Select 'Use a formula to determine which cells to format'.
  4. In the 'Format values where this formula is true:' box, enter our COUNTIF formula.
  5. Choose the formatting you want to apply (like fill color), then click 'OK'.

Applying the Rule to Entire Columns or Rows

Google Sheets - Conditional Formatting Based on Another Cell
Google Sheets - Conditional Formatting Based on Another Cell

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.

Using Conditional Cell Formatting in Excel 2007
Using Conditional Cell Formatting in Excel 2007
the basic excel formats for each type of text, including numbers and letters in green
the basic excel formats for each type of text, including numbers and letters in green
How to apply conditional formatting search for multiple words in Excel?
How to apply conditional formatting search for multiple words in Excel?
Excel Conditional Formatting
Excel Conditional Formatting
Excel Conditional Formatting tutorial with examples
Excel Conditional Formatting tutorial with examples
How to Apply Conditional Formatting in Excel - Highlight Data Visually
How to Apply Conditional Formatting in Excel - Highlight Data Visually
Conditional Formatting on Text that Contains Multiple Words in Excel
Conditional Formatting on Text that Contains Multiple Words in Excel
Excel Conditional Formatting Tutorial
Excel Conditional Formatting Tutorial
How (and why) to use conditional formatting in Excel
How (and why) to use conditional formatting in Excel
Change Cell Colour using Conditional Formatting
Change Cell Colour using Conditional Formatting
Conditional Format Borders in Excel‼️ #excel
Conditional Format Borders in Excel‼️ #excel
Excel Keyboard Shortcuts Every Office User Should Know
Excel Keyboard Shortcuts Every Office User Should Know
Calender in Excel ‼️ Amazing Excel trick using data validation and conditional formatting ✅ #Excel
Calender in Excel ‼️ Amazing Excel trick using data validation and conditional formatting ✅ #Excel
5 Handy Excel Tricks for Conditional Formatting Every Analyst Should Know
5 Handy Excel Tricks for Conditional Formatting Every Analyst Should Know
a poster with the words excel text to columns
a poster with the words excel text to columns
a printable worksheet with the words, conditions and abbreviations in it
a printable worksheet with the words, conditions and abbreviations in it
Conditional Sentences Made Easy | Zero, First, Second & Third Conditional Rules
Conditional Sentences Made Easy | Zero, First, Second & Third Conditional Rules
the excel ctrl shortcuts cheat sheet
the excel ctrl shortcuts cheat sheet
6 Times Excel's Conditional Formatting Saved My Sanity
6 Times Excel's Conditional Formatting Saved My Sanity

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!