Home Guides Excel

Excel

How to Use Conditional Formatting in Excel: Practical Rules

A practical reference for Excel conditional formatting: threshold rules, duplicates, overdue dates, formula-based row highlights, PivotTable considerations and troubleshooting rule references.

In this guide Step-by-step explanations, practical examples and useful context to help you complete the task confidently.

Conditional formatting is most useful when it answers a specific review question: which values need attention, which records break a rule, or where a pattern deserves investigation? It changes how cells look, not the underlying data. Treat highlighting as a review signal rather than proof that a record is correct.

Choose a rule that matches the question

  • Threshold: highlight values above or below a defined target.
  • Duplicate values: flag repeated IDs, emails or codes for review before removing anything.
  • Date condition: identify overdue items while excluding blanks.
  • Formula rule: format a row or cell when a combination of conditions is true.
  • Color scale or data bar: compare relative values when a precise pass/fail threshold is not the goal.

Threshold rules

Select the intended cells, open Home > Conditional Formatting, choose a suitable Highlight Cells rule, enter the threshold and choose a restrained format. Decide whether equality should count: greater than 100 and greater than or equal to 100 are different business rules. Test a value below, at and above the threshold.

Duplicate values need human review

Use Highlight Cells Rules > Duplicate Values on the relevant field. A repeated value is not always a duplicate record: a customer may have multiple legitimate orders. Confirm the key and inspect the full record before deleting rows.

Overdue dates while ignoring blanks

If due dates start in A2, a formula rule can use:

=AND(A2<TODAY(),A2<>"")

Apply the rule to the matching date range, with the formula written relative to its top-left cell. The blank test prevents empty cells from being treated as overdue. If your workbook uses text dates, normalize them before relying on date comparisons.

Highlight an entire row from a status field

Suppose the status is in column C and the first data row is row 2. Select the full data range and use:

=$C2="Pending"

The dollar sign fixes the status column while the row reference changes for each row. The formula must be written relative to the top-left row of the selected range; if your selection starts on row 5, adjust the formula accordingly.

Use color scales and data bars with care

Color scales communicate relative high and low values; data bars show relative magnitude inside cells. They are useful for scanning a report, but can mislead when the reader assumes a color means a fixed threshold. Use a clear numeric rule when an action depends on a specific limit, and include a legend when color meaning is not self-evident.

PivotTables and changing ranges

Conditional formatting on a PivotTable can depend on whether the rule applies to selected cells, a field, or the displayed values. Refresh the PivotTable and test the rule after changing its layout. For ordinary ranges, check that newly added rows are included in the rule's Applies to range.

Troubleshoot unexpected highlights

  1. Select an affected cell and open Home > Conditional Formatting > Manage Rules.
  2. Inspect the rule condition and its Applies to range.
  3. For formula rules, verify relative and absolute references against the range's top-left cell.
  4. Check rule order when multiple rules can format the same cell.
  5. Test one row that should match and one that should not, including blanks and boundary values.
  6. Sort, filter, add a row or refresh a PivotTable if those actions are part of normal use.

Common mistakes

  • Applying the rule to the wrong range or starting row.
  • Locking a row or column with dollar signs when it should move.
  • Highlighting blank dates unintentionally.
  • Deleting duplicates before confirming the record key.
  • Creating so many colors and rules that the sheet becomes harder to read.
  • Assuming a colored cell changes its underlying value or validates the data.

Practical rule checklist

Write the condition in plain language; choose the simplest rule; apply it to the correct range; test matching and non-matching examples; verify boundary values and blanks; and recheck the rule after the workbook structure changes.

For a concise start-to-finish walkthrough of applying common conditional-formatting rules, see How to Apply Conditional Formatting in Excel.

You've reached the end

Use the related tools, FAQs and next guides below to continue from the topic you just learned.

Questions & answers

Frequently Asked Questions

Does conditional formatting change the value in a cell?

No. It changes the cell's appearance based on a rule; the underlying value remains unchanged.

How do I highlight an entire row based on a cell?

Select the full data range and use a formula rule such as =$C2="Pending", locking the status column while leaving the row relative.

Why is my conditional formatting highlighting the wrong rows?

Check the first cell in the selected range and the absolute/relative references in the rule.

Can conditional formatting work with PivotTables?

Yes, Excel supports conditional formatting in PivotTable reports, although some rule types have additional considerations.

Learn more

Related Articles

Understand the wider topic with an informative Tervilo article.