This tutorial gives a complete view of how to use conditional formatting and what options are available. It also gives you a list of examples you can learn to use in the real world while working with data.
What is Conditional Formatting?
Conditional Formatting is an option to apply to a cell or a range with a condition. When you use it, it tests a condition first, and only if that condition is TRUE will it apply the formatting. For example, you may want to use red for all the cells in a range with an error or for all the blank cells.
You can use conditional formatting in two ways:
- Pre-Defined Rules
- Custom Rule with a Formula
In this tutorial, we will learn about both.
Simple Example to Understand Conditional Formatting
Let’s take an example to understand conditional formatting. In the example below, you have names, and you must highlight the cells with “Aryan” in the name.

- For this, go to Home > Conditional Formatting > Highlight Cells Rules > Text that Contains.

- Once you click on the options, it will show you a dialog box where you can enter the text “Aryan” and then define the color you want to apply to the matching cell.

- It will instantly highlight the cells where the text “Aryan” is there. And after that, click OK.

Let’s understand this: Here, we have a condition test for the cells with the text “Aryan” in it. And only the cells where you have this text are highlighted.
Note: Conditional Formatting is one of the most useful tools to help you quickly analyze data in real-time in Excel.
Available Pre-Defined Conditional Formatting Rules
Five major options have pre-defined rules for you to use in conditional formatting. With pre-defined options, there comes the pre-defined formatting to apply.

1. Highlight Cells Rules
With the Highlight Cells Rules, you can apply conditional formatting to the cells by checking their values. If you want to highlight a cell where a number is less than 1500, you can use the Less Than option from the list.

Here you have options to deal with all kinds of data, like text, dates, and numbers.
2. Top/Bottom Rules
With the Top and Bottom options, you can analyze your data quickly. There are options to highlight the top 10 or bottom 10 values (or the top and bottom 10%) and values below or above the average.

Even further, you can customize these options per your needs; let’s say, if you want to highlight the top 20 values instead of the 10, you can do that.
3. Data Bars
Data bars are tiny in-cell charts that show a bar based on the value in each selected cell. Excel looks at the highest and lowest values and sizes the data bars in all the selected cells based on them.

Tip: When you change the column’s width, the data bar adjusts its width according to that.
4. Color Scales
Color Scales help you highlight the cells based on your values in the range. There are two-color and three-color scales that you can use, and Excel has 12 pre-defined color scales in the list.

These color scales help you quickly identify data in no time.
5. Icon Sets
With Icon sets, you can apply the icon to a cell based on its values compared to those in the range. For example, if a value is higher in the range, it will get an upwards arrow; if it’s lower, it will be a downward arrow.

And as you can see, you have several icon sets to use.
Note: These pre-defined rules will be useful in over 80% of situations. And if you want to go further, you can create a custom rule.
Create a Custom New Rule
And you can also create custom rules if you want. When you click on Home ➜ Conditional Formatting ➜ “New Rule”, it opens a dialog box where you can choose to create a custom rule to apply conditional formatting.

In this dialog box, you can select any of the options we discussed above and customize them. And in this dialog box, you have one more option which allows you to apply a rule with a custom formula. You can learn more from these detailed tutorials to use conditional formatting in a specific way:
- Apply Conditional Formatting on Blank Cells
- Compare Two Columns using Conditional Formatting
- Apply Conditional Formatting Based on Another Cell
- Apply Conditional Formatting Based on Another Column
- Copy Conditional Formatting from Range to Another
- Apply Conditional Formatting to an Entire Column
- Highlight Rows using Conditional Formatting
- Apply Multiple Conditions in Conditional Formatting
- Conditional Formatting Not Working
- Highlight IF a Cell Contains a Specific Text with Conditional Formatting in Excel
- Apply Conditional Formatting Based on a Date
- Applying Color Scales using Conditional Formatting
- How to Add Data Bars in Excel
- Find and Highlight Duplicates in Excel using Conditional Formatting
- Stop IF True in Conditional Formatting
- Remove Conditional Formatting in Excel
Use a Formula in Conditional Formatting
The formula option gives you full control. Select the range (like A2:D20), go to Home ➜ Conditional Formatting ➜ New Rule ➜ Use a formula to determine which cells to format, enter a formula that returns TRUE or FALSE for the first row of the range, and pick the format. The following formula highlights the entire row when the value in column C is more than 1500:
=$C2>1500
The $ before C locks the column, so every cell in the row checks column C, while the row number changes for each row. And the same way, this formula highlights the rows where the name in column A contains “Aryan”:
=ISNUMBER(SEARCH("Aryan",$A2))
Clear Rule
Conditional formatting is formatting, and you can remove it from a cell or a range of cells without removing the values. Go to Home ➜ Conditional Formatting ➜ Clear Rules, and choose Clear Rules from Selected Cells or Clear Rules from Entire Sheet.

Or you can also use the keyboard shortcut Alt > E > A > F to clear all the formatting from the selected cell or range. But note that this shortcut also removes the normal formatting (fonts, fills, borders and number formats), not just the conditional formatting.
Managing Rules
This option (Home ➜ Conditional Formatting ➜ Manage Rules) helps you manage all the conditional formatting rules in a worksheet or selection. With the Rules Manager, you can:
- Edit or Delete a Rule.
- Create a Duplicate or a New Rule.
- Change the Applies to Range.
- And also change the order of the rules.
Stop IF True
When you tick the Stop If True option for a rule, Excel stops applying the rules below it to a cell when that rule’s condition is true for the cell.
Using Cell Formatting in Conditional Formatting
Conditional formatting allows you to apply formatting to a cell using the Format Cells options. You get most of the formatting options that you have there.

- Number formatting
- Font Formatting
- Border
- Cell Formatting
Cell formatting here means the Fill tab (background color and pattern). Just note that you can’t change the font name or the font size with conditional formatting; those options are greyed out.
Identify All the Cells where Conditional Formatting is Applied
First, open the Go To Special option from Home > Find & Select > Go To Special.

In the Go To Special dialog box, select Conditional formats, and then click OK.

And the moment you click OK, it selects the cells where the conditional formatting is applied.

A Few Points to Consider Before Using Conditional Formatting
- Excessive conditional formatting in a workbook can make it a heavy and slow Excel file.
- While using formulas with conditional formatting, you must take care of the cell reference.
- If you share an Excel workbook with someone else, the conditional formatting stays intact.
Frequently Asked Questions
Does conditional formatting change the values?
No. It only changes how the cells look. The values stay the same, and when the values change, Excel checks the rules again and updates the formatting.
What happens when two rules apply to the same cell?
Both are applied, but when they conflict (like two different fill colors), the rule higher in the Manage Rules list wins. Use the arrows in Manage Rules to change the order.
Why is my formula rule highlighting the wrong cells?
The formula must be written for the first cell of the selected range, with $ signs where needed. If you select A2:D20 but write the formula for row 1, every row checks the row above it.
Written by
Puneet Gogia
Microsoft MVP — Excel · Founder, Excel Champs
Twelve years of teaching Excel, and a decade before that using it as a data analyst. Every tutorial here is written from a file I actually built.