Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Use Conditional Formatting in Excel

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Conditional formatting in Excel lets you automatically change how cells look—like their color, font, or border—based on their values or formulas. It helps highlight trends, spot errors, or visualize data without manual work. No add-ins or special permissions are needed; it works in all modern Excel versions (Microsoft 365, Excel 2016 and later) on Windows, Mac, and Excel Online.

What You'll Need

  • Excel installed (Microsoft 365, Excel 2016+, or Excel for the web)
  • A worksheet with data you want to analyze or highlight
  • Basic understanding of cell references (e.g., A1, B2)

Step-by-Step

  1. Select your data range. Click and drag to highlight the cells you want to format conditionally, or press Ctrl+A (Cmd+A on Mac) to select the entire data table. Make sure your selection includes only the relevant cells—avoid selecting blank columns or rows unless intended.
  2. Open the Conditional Formatting menu. Go to the Home tab on the ribbon, then click Conditional Formatting in the Styles group. A dropdown menu will appear with preset options.
  3. Choose a rule type. For simple highlighting, pick Highlight Cell Rules (e.g., Greater Than, Less Than, Between, Equal To, Text That Contains, A Date Occurring). For more control, select New Rule to build a custom formula.
  4. Set the condition and format. In a preset rule like Greater Than, enter the value (e.g., 100), then choose a formatting style (e.g., Light Red Fill with Dark Red Text). Click OK to apply. For New Rule, in the Format values where this formula is true option, type your formula (e.g., =A1>100), then click Format to set fill color, font, borders, etc.
  5. Apply multiple rules if needed. Repeat steps 2–4 to add more rules to the same range. Each rule is evaluated in order, and the first matching rule’s formatting is applied unless you set a stop condition (see tips).
  6. Verify the rule is working. Enter or change values in your selected range to see if formatting updates automatically. For example, if you set a rule to highlight values over 100 in red, typing 101 should turn the cell red.
  7. Manage existing rules. Go back to Conditional Formatting > Manage Rules. Here you can see all rules for the current sheet or entire workbook, change the range, adjust the rule order (which affects priority), edit, delete, or enable/disable rules.

Common Mistakes

  • Using absolute references incorrectly. If your formula uses $A$1 instead of A1, the rule won’t adjust per cell. Relative references (e.g., A1) are usually needed for per-cell evaluation.
  • Applying rules to empty cells. Formatting may persist on blank cells if they previously held values. Clear formatting from empty cells first, or use ISBLANK() in your formula to skip them.
  • Forgetting to lock the cell reference in formulas. In custom formulas, always decide whether to use relative (A1), mixed ($A1 or A$1), or absolute ($A$1) references. A common error is writing =B1>A1 for a whole column, which works only if the formula is relative to each row.
  • Overlapping rules with conflicting priorities. If two rules target the same cell, only the highest-priority one applies. Use Manage Rules to reorder them—drag a rule up to give it precedence.
  • Excluding headers by accident. When selecting a range, include or exclude headers consistently. Conditional formatting on headers can cause errors or mislead readers.

Tips

  • Use icon sets for quick scanning. Under Conditional Formatting, choose Icon Sets (e.g., arrows, traffic lights). They show direction or status at a glance—ideal for sales, scores, or progress tracking.
  • Apply data bars for visual magnitude. Data Bars fill cells with horizontal bars proportional to their value. Go to Conditional Formatting > Data Bars and pick a style. Adjust min/max values in Manage Rules for consistency.
  • Use formulas for complex logic. Combine functions like AND(), OR(), and NOT() in custom rules. Example: =AND(A1>50, B1="Complete") highlights rows where column A exceeds 50 and column B says "Complete".
  • Clear formatting selectively. To remove only conditional formatting (not cell content), go to Conditional Formatting > Clear Rules > Clear Rules from Selected Cells or Entire Sheet.
  • Copy conditional formatting with Format Painter. Select a formatted cell, click Format Painter (Home tab), then drag over other cells to replicate the rule. Note: this copies the rule, including its cell references—adjust the range in Manage Rules if needed.
  • Test with sample data. Before applying rules to large datasets, test on 3–5 rows to ensure the formula behaves as expected.

Troubleshooting

If your conditional formatting doesn’t update or apply correctly, follow these checks:

  1. Check if the rule is enabled. In Manage Rules, ensure the Stop if True box isn’t checked unintentionally, and the rule status is set to Enabled.
  2. Verify the applied range. In Manage Rules, confirm the Applies to range matches your selection. If you added rows, the range might not have expanded—click the range selector button (tiny square icon) to reselect or manually edit the range (e.g., $A$2:$A$100).
  3. Check cell values and formats. Is the cell truly meeting the condition? If using text, ensure spelling and case match (e.g., "Yes" vs. "yes"). If using dates, confirm Excel recognizes the value as a date (not text).
  4. Restart Excel. Rarely, Excel’s rendering glitches prevent formatting from updating. Close and reopen the file.
  5. Check for manual overrides. If you manually changed a cell’s fill or font color after applying conditional formatting, Excel preserves that manual format. Clear manual formatting by selecting the cell, going to Home > Font or Fill Color, and choosing No Color.
  6. Disable conflicting rules. In Manage Rules, temporarily uncheck other rules to isolate the problem. Re-enable one by one.
  7. Ensure calculation mode is Automatic. Go to Formulas tab > Calculation Options and confirm Automatic is selected. Manual mode prevents real-time updates.

Frequently Asked Questions

Can conditional formatting use formulas from other sheets?

Yes, but only if the referenced sheet is open in the same workbook. For example, =SUM(Sheet2!A1:A10)>50 works, but if Sheet2 is closed, the rule may show #VALUE! or not update reliably.

Does conditional formatting affect cell values or calculations?

No. It only changes visual appearance (font, fill, borders). The underlying data remains unchanged, so formulas and functions use the raw values, not the formatted style.

How many conditional formatting rules can I apply to one cell?

Excel allows up to 64 rules per cell in modern versions. However, too many rules slow down large spreadsheets. Prioritize essential rules and remove unused ones via Manage Rules.

Can I apply conditional formatting to pivot tables?

Yes, but with limitations. Select the pivot table data area (not the entire pivot), then apply rules as usual. Note: dynamic changes to the pivot (like filtering or refreshing) may reset or shift formatting. Re-run the rule after major pivot edits.

Why does my rule work on some rows but not others?

Most commonly, the cell references in your formula aren’t relative. If your formula is =B2>10 but applied to $A$2:$A$100, it only checks B2 for every cell in column A. Use =B1>10 instead (Excel auto-adjusts relative references per cell), or lock references only when intentional.

Is conditional formatting saved when sharing files?

Yes. Rules and formatting are embedded in the workbook file (.xlsx, .xlsb, etc.). Recipients will see the formatted cells unless they open the file in a very old Excel version (pre-2007) that lacks support for newer features.