Excel: Conditional Formatting if Cell Contains Text From Another Cell

Ever found yourself poring over Excel sheets, wishing you could quickly identify cells containing specific text? While Excel's built-in features are robust, they might not always seem intuitive. Today, we're going to explore a powerful tool: conditional formatting, with a focus on how to apply it when a cell contains text from another cell.

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

Conditional formatting is a game-changer in Excel. It allows you to apply specific formatting to cells based on their values. This could be as simple as changing the font color or as complex as displaying an icon. In this guide, we'll delve into using conditional formatting to highlight cells that contain text found in another cell.

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

Understanding the Basics of Conditional Formatting

Before we dive into the specifics, let's ensure we're on the same page regarding conditional formatting. At its core, conditional formatting is a set of rules that Excel applies to cells based on their values. These rules can be as simple as "if a cell's value is greater than 0, make the text red".

How to conditional formatting if the cell contains partial text in Excel?
How to conditional formatting if the cell contains partial text in Excel?

To access conditional formatting, select the cells you want to format, then click on the 'Home' tab in the ribbon. In the 'Styles' group, click on 'Conditional Formatting'. This will open a dropdown menu where you can choose from a variety of formatting options or create new rules.

Using the 'Use a Formula to Determine Which Cells to Format' Option

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

For our purpose, we'll be using the 'Use a Formula to Determine Which Cells to Format' option. This allows us to use a formula to specify which cells should be formatted. The formula should return TRUE for the cells you want to format and FALSE for those you don't.

For example, if you want to format cells that contain the text "Apple", you might use the formula "=A1="Apple"". However, this only works if you're checking cell A1. What if you want to check a range of cells, or a cell that's not A1?

Using the 'IF' Function in Conditional Formatting

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

This is where the 'IF' function comes in. The 'IF' function allows you to test a condition and return one value if the condition is true, and another value if it's false. In our case, we want to test if a cell contains a specific text, and if it does, we want to format that cell.

Here's how you can do it. Suppose you want to format cells that contain text found in cell A1. In the 'Use a Formula to Determine Which Cells to Format' dialog box, enter the following formula: "=IF(ISNUMBER(SEARCH(A1, B1)), TRUE, FALSE)". This formula tests if the text in cell A1 is found in cell B1. If it is, the formula returns TRUE, and the cell is formatted. If not, it returns FALSE, and the cell is not formatted.

Applying Conditional Formatting to a Range of Cells

Conditional formatting in Excel: Learn with Examples
Conditional formatting in Excel: Learn with Examples

Now that we know how to format a cell based on the text in another cell, let's extend this to a range of cells. Suppose you want to format cells B1:B10 if they contain text found in cell A1.

To do this, simply replace "B1" in the formula with "B1:B10". So, your formula would look like this: "=IF(ISNUMBER(SEARCH(A1, B1:B10)), TRUE, FALSE)". This formula tests each cell in the range B1:B10 to see if it contains the text in cell A1. If it does, the cell is formatted. If not, it's not formatted.

Excel Conditional Formatting
Excel Conditional Formatting
an excel spreadsheet with multiple columns and numbers
an excel spreadsheet with multiple columns and numbers
Excel Conditional Formatting with Formula If Cell Contains Text
Excel Conditional Formatting with Formula If Cell Contains Text
the basic excel formats for each type of text, including numbers and letters that are in
the basic excel formats for each type of text, including numbers and letters that are in
Excel conditional formatting formulas based on another cell
Excel conditional formatting formulas based on another cell
Excel Count Cells with Text - Text and Values, Count any Text, Occurrence of specific Text
Excel Count Cells with Text - Text and Values, Count any Text, Occurrence of specific Text
Google Sheets - Conditional Formatting Based on Another Cell
Google Sheets - Conditional Formatting Based on Another Cell
How to Copy Conditional Formatting to Another Cell in Excel (2 Methods)
How to Copy Conditional Formatting to Another Cell in Excel (2 Methods)
Change Cell Colour using Conditional Formatting
Change Cell Colour using Conditional Formatting
Format Cells in Excel Based on the Condition or Content
Format Cells in Excel Based on the Condition or Content
3 Crazy Microsoft Excel Formulas That Are Extremely Useful
3 Crazy Microsoft Excel Formulas That Are Extremely Useful
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 in Excel
Conditional Formatting in Excel
a screenshot of the format dialog box with an arrow pointing to the text area
a screenshot of the format dialog box with an arrow pointing to the text area
5 Handy Excel Tricks for Conditional Formatting Every Analyst Should Know
5 Handy Excel Tricks for Conditional Formatting Every Analyst Should Know
Conditional Formatting in Excel (Complete Guide + Examples)
Conditional Formatting in Excel (Complete Guide + Examples)
Excel Conditional Formatting Tutorial
Excel Conditional Formatting Tutorial
Apply Conditional Formatting on Multiple Texts in Excel
Apply Conditional Formatting on Multiple Texts in Excel
Conditional Formatting on a Row in Excel
Conditional Formatting on a Row in Excel

Formatting Cells Based on Text in Another Cell on Another Sheet

What if the text you want to search for is in a cell on another sheet? Unfortunately, the 'SEARCH' function can't search across sheets. However, you can use the 'INDIRECT' function to get around this limitation.

Suppose you want to format cells B1:B10 if they contain text found in cell Sheet2!A1. You can use the following formula: "=IF(ISNUMBER(SEARCH(Sheet2!A1, B1:B10)), TRUE, FALSE)". The 'INDIRECT' function allows you to reference a cell on another sheet.

And there you have it! You now know how to use conditional formatting to highlight cells that contain text found in another cell, whether it's on the same sheet or another one. This can be a powerful tool for quickly identifying and formatting cells that meet specific criteria.

Remember, the key to effective use of conditional formatting is to keep your formulas simple and easy to understand. This will make it easier to troubleshoot any issues that may arise. Happy formatting!