How to use conditional formatting in Excel — apply rules, formulas, and troubleshoot

How to use conditional formatting in Excel — apply rules, formulas, and troubleshoot

Quick answer: Use the Conditional Formatting menu on the Home tab to apply built-in rules (highlight cells, top/bottom, data bars, color scales, icon sets) or choose New Rule to enter a formula. Assign the rule to the correct range, set formatting, and manage rule order in Manage Rules to control priority.

What conditional formatting in Excel does and when to use it

Conditional formatting in Excel converts values and patterns into visual cues so you and others can scan a sheet and spot outliers, trends, or missing items. Use it when you want immediate visual signals for rules such as low inventory, overdue dates, top performers, or relative values within a column.

This article focuses on practical, step-by-step actions: applying built-in rules, writing formula-based rules, using color scales and icon sets, managing rule priority, and troubleshooting common mistakes.

Quick steps to apply a built-in conditional format

  1. Select the cells you want to format.
  2. On the Home tab, open Conditional Formatting and pick a rule type (Highlight Cell Rules, Top/Bottom Rules, Data Bars, Color Scales, Icon Sets).
  3. Set the rule parameters (value, percent, formula where applicable) and choose formatting (fill color, font color, icon).
  4. Confirm and, if necessary, return to Manage Rules to adjust the rule range or priority.

Built-in rules are the fastest way to highlight numbers or dates. For tailored logic you will use formula-based rules, described next.

Using formula-based rules for precise control

Formula-based rules let you express logic that built-in templates cannot, for example: highlight rows where sales are below a target or flag cells that depend on values in another column.

When to choose a formula-based rule

Worked example: highlight sales below a target

  1. Assume your sales values are in B2:B100 and the company target is in D1.
  2. Select B2:B100 (or select the entire rows B2:E100 if you want to color the whole rows).
  3. Open Home > Conditional Formatting > New Rule.
  4. Choose 'Use a formula to determine which cells to format'.
  5. Enter the formula: =B2<$D
    . Note the mixed references: B2 is the first cell in the apply-to range and $D
    is an absolute reference to the target.
  6. Click Format, choose a fill color, and apply. Verify that the rule's Range in Manage Rules is correct.

This approach ensures Excel applies the formula to each row relative to the starting cell. For other formulas, keep the same principle: write the formula as if you were evaluating the top-left cell of the selected range.

Color scales, data bars, and icon sets — visual summaries

Color scales, data bars, and icon sets are best when you want to show relative magnitude or categories across a range.

When to use each

Practical tip

When combining icon sets or color scales with other rules, expect overlap. Use Manage Rules to control which visual takes precedence and verify the formatting looks correct on sample rows before rolling out to a full report.

Rule Manager and priority — controlling overlapping rules

Open Home > Conditional Formatting > Manage Rules to see all applied rules for the active sheet or selection. The list shows the rule, the applied range, and the formatting.

How priority works

Practical checks in Manage Rules

Troubleshooting common mistakes

Most issues stem from reference errors, range selection, or rule order. Here are frequent problems and fixes.

Checklist before sharing a workbook

  1. Verify all 'Applies to' ranges are precise and do not include entire columns unless necessary.
  2. Confirm formula-based rules reference the correct "first cell" and use absolute references where appropriate.
  3. Consolidate overlapping rules or reorder them in Manage Rules so the intended formatting is visible.
  4. Remove unnecessary rules and keep an eye on file size and calculation time.
  5. If you need to replicate formatting on another sheet, use the formatting copy tools; guidance at How to copy formatting between Excel sheets and workbooks.

When to use formulas versus built-in rules

Use built-in rules for standard tasks such as highlighting numbers above a threshold or top 10% values. Choose formula-based rules when logic depends on multiple cells, different sheets, or a custom combination of conditions. For help writing robust formulas, see Using Excel formulas: structure and best practices.

Closing: practical next steps

Start with one clear goal for conditional formatting — highlight underperforming items, spot missing dates, or visualize distribution — and implement the simplest rule that achieves it. Test on a small sample, verify ranges and references in Manage Rules, and keep formatting limited to the cells that need it. If performance becomes an issue, review workbook design and consult performance guidance to streamline rules and calculations.