What conditional formatting does and when to use it

Conditional formatting is a tool that automatically changes how a cell looks — its color, font, or borders — based on the value inside it. You set a rule once, and Excel applies it to every cell that matches. For example, you can make all sales numbers below $5,000 turn red, or highlight every date that is more than 30 days old, or shade every cell containing the word "urgent" in yellow.

The most common reason to use it is to spot patterns at a glance. A spreadsheet with 500 rows of data is hard to scan with your eyes. A spreadsheet where the problem rows are already colored is not. You use conditional formatting when you want to flag something without adding a new column or sorting the data.

Excel comes with built-in conditional formatting rules for common tasks, and you can also write your own rules using formulas. The steps are the same either way: select the cells, pick a rule type, and set the condition.

Key Takeaways

  • Select the cells you want to format first, then open the conditional formatting menu from the Home tab in the ribbon.
  • Built-in rules like "Highlight Cell Rules" and "Top/Bottom Rules" work without writing a formula and cover the most common tasks.
  • Custom formulas let you create rules based on multiple conditions, comparisons to other cells, or text patterns that the built-in rules do not cover.
  • Once you create a rule, it stays with those cells even if the values change, so you can update your data without resetting the formatting.

Selecting cells and opening the conditional formatting menu

Start by clicking on the first cell you want to format. Then hold Shift and click on the last cell in the range you want to cover. If the cells are not next to each other, hold Ctrl and click each cell or range separately. Excel will highlight all selected cells in blue.

Once you have selected the cells, look at the top of the screen for the ribbon. Click the Home tab if it is not already open. In the ribbon, find the button labeled Conditional Formatting — it is usually in the Styles group on the right side of the Home tab. Click it to open a dropdown menu with your options.

If you cannot find the Conditional Formatting button, your ribbon may be collapsed. Look for a small arrow or chevron icon and click it to expand the full ribbon. The button will appear once the ribbon is fully visible.

Using built-in rules for common formatting tasks

The easiest way to start is with the built-in rules. In the Conditional Formatting dropdown, you will see options like Highlight Cell Rules, Top/Bottom Rules, and Data Bars. Each one handles a specific type of task without requiring you to write anything.

Highlight Cell Rules lets you color cells based on their content. Click it and you will see options like "Greater Than", "Less Than", "Between", "Equal To", and "Text that Contains". Pick the one that matches what you want to find. A dialog box will open asking you to enter the value or text to match. For example, if you choose "Greater Than" and type 50000, every cell with a value above 50,000 will be highlighted. You can then pick what color to use from the dropdown.

Top/Bottom Rules highlights the highest or lowest values in your range. Click it and choose "Top 10 Items", "Bottom 10 Items", "Top 10%", or "Bottom 10%". A dialog will ask how many items or what percentage you want to highlight. This is useful when you want to see your best performers or worst performers without sorting the entire sheet.

Data Bars fills each cell with a colored bar proportional to its value — taller bars for bigger numbers, shorter bars for smaller ones. This makes it very easy to spot which rows have the highest or lowest values at a glance. Click Data Bars, pick a color, and Excel will apply it to all selected cells.

Creating a custom rule with a formula

If the built-in rules do not cover what you need, you can write your own rule using a formula. In the Conditional Formatting dropdown, click New Rule. A dialog box will open with several options at the top. Click the one that says Use a formula to determine which cells to format.

In the formula field, type a formula that returns TRUE or FALSE. When the formula is TRUE for a cell, that cell gets formatted. When it is FALSE, it does not. For example, if you want to highlight every cell in column A that is greater than the average of all cells in column A, you would type =A1>AVERAGE($A$1:$A$100). The dollar signs lock the range so it does not change as the rule moves down the column.

Here are some common formula examples: =A1="URGENT" highlights cells containing the word URGENT; =AND(A1>100, A1<500) highlights cells between 100 and 500; =TODAY()-A1>30 highlights dates older than 30 days. Once you type your formula, click the Format button to choose the color or style, then click OK.

The most common mistake is forgetting the dollar signs. If you write =A1>50 without dollar signs, Excel will adjust the reference as it moves down — the second row will check B1, the third will check C1, and so on. Use dollar signs to keep the reference fixed: =$A$1>50 checks the same cell for every row, or =A$1>50 to lock only the row.

Changing or removing a rule you have already created

Once you have applied conditional formatting, you can edit or delete the rule without starting over. Select the cells that have the formatting, then click Conditional Formatting in the Home tab. At the bottom of the dropdown, click Manage Rules. A window will open showing every rule applied to your selection.

To change a rule, click on it to highlight it, then click Edit Rule. You can modify the condition, the formula, or the formatting color. Click OK when you are done. To remove a rule entirely, click on it and then click Delete Rule. If you want to remove all conditional formatting from a range, select the cells, click Conditional Formatting, and choose Clear Rules.

If you have the same rule on multiple ranges and want to update it everywhere at once, use Manage Rules. You can edit the rule once and it will change on all the cells where you applied it, as long as you do not close the Manage Rules window between edits.

Avoiding common mistakes with conditional formatting

The most frequent problem is applying a rule to the wrong range. Always double-check that you have selected the correct cells before you open the Conditional Formatting menu. If you select too few cells, the rule will not cover your whole dataset. If you select too many, you may format cells you did not intend to.

Another common issue is creating a rule that is too broad. For example, if you write a formula that highlights any cell containing a number, it will highlight every cell in your range, which defeats the purpose. Test your rule on a small sample first. Apply it to five or ten cells, check that it works the way you expect, and then expand it to your full range.

Performance can slow down if you create too many rules on a very large range. Excel has to check every rule against every cell every time the data changes. If your spreadsheet starts to feel sluggish, open Manage Rules and delete any rules you no longer need. Combining multiple conditions into one formula is faster than creating separate rules for each condition.

Copying conditional formatting to other cells

Once you have created a rule on one range, you can copy it to other cells without recreating it. Select the cells that already have the formatting. Then click the Format Painter button in the Home tab — it looks like a paintbrush. Your cursor will change to a paintbrush icon. Click and drag to select the cells where you want to paste the formatting. The rule will copy over, and Excel will automatically adjust the cell references if needed.

If Format Painter does not work the way you expect, use copy and paste instead. Select the cells with the formatting, press Ctrl+C to copy, then select the destination cells and press Ctrl+V to paste. Excel will paste both the values and the conditional formatting rules together. If you only want the formatting and not the values, right-click after pasting and choose Paste Special, then check only the Formats box.

Frequently Asked Questions

Can I use conditional formatting on cells that already have a background color?

Yes. Conditional formatting will override the existing background color when the rule is TRUE. When the rule is FALSE, the original color shows through. If you want to avoid confusion, remove the manual formatting first, then apply conditional formatting to the whole range.

What happens to conditional formatting if I copy and paste cells to a different sheet?

The formatting copies with the cells. If you paste into a different sheet, the rule comes along. However, if your rule uses a formula that references cells on the original sheet, it may not work correctly on the new sheet. Check the rule in Manage Rules and update the cell references if needed.

Can I apply conditional formatting to an entire column?

Yes. Click the column header to select the whole column, then apply the rule as normal. Be aware that this can slow down your spreadsheet if the column is very large or if you have many rules. It is usually faster to select only the range that contains data.

How do I highlight cells based on the value of a different cell?

Use a custom formula. For example, if you want to highlight all cells in column A that are less than the value in cell B1, select column A and create a rule with the formula =A1<$B$1. The dollar signs lock B1 so it does not change as the rule moves down the column.

Can I use conditional formatting to change font color instead of background color?

Yes. When you click the Format button in the New Rule dialog, you can choose font color, bold, italic, or borders instead of background color. Pick the formatting style you want before you click OK.