Pinterest Pixel

Conditional Formatting With Formula in Excel: A Practical Guide

John Michaloudis
Conditional formatting is a great tool available in Excel that is used to highlight important information in a large set of data.
The various rules include highlighting top values, highlighting duplicate values, and adding color bars or color cells.

But sometimes the built-in rules are not enough; this is where formulas come in.

Conditional formatting is a great tool available in Excel that is used to highlight important information in a large set of data. The various rules include highlighting top values, highlighting duplicate values, and adding color bars or color cells. But sometimes the built-in rules are not enough; this is where formulas come in.

In this article, you will learn how to use conditional formatting with formulas in Excel.

Key Takeaways:

  • Conditional Formatting highlights important data automatically.
  • Formulas help you create custom formatting rules.
  • You can highlight entire rows based on one cell.
  • Functions like TODAY and COUNTIF can be used in formulas.
  • Conditional Formatting updates when your data changes.

 

Introduction to Conditional Formatting

Define Conditional Formatting

Conditional Formatting is a feature that changes the format of a cell based on a specific condition. Instead of manually changing the format of the data, Excel will highlight important values for you. For example, you can highlight sales above $10,000, mark overdue dates in red, identify duplicate entries, or highlight an entire row when a particular condition is met.

When the values in the worksheet change, Excel automatically checks the condition again and updates the formatting.

Conditional Formatting can change several formatting properties, including:

  • Cell background color
  • Font color
  • Font style
  • Cell borders
  • Number formats

Conditional Formatting Rules

  • Highlight Cells Rules: These rules highlight cells based on conditions such as Greater Than, Less Than, Between, Equal To, Text that Contains, A Date Occurring, and Duplicate Values.
  • Top/Bottom Rules: These rules help identify values such as the Top 10 Items, Top 10%, Bottom 10 Items, Bottom 10%, Above Average, and Below Average.
  • Data Bars: Data Bars display horizontal bars inside cells. Larger values have longer bars, making it easy to visually compare numbers.
  • Color Scales: Color Scales use different colors to represent high, medium, and low values.
  • Icon Sets: Icon Sets add symbols such as arrows, circles, flags, or ratings based on the value of each cell.

 

Apply Conditional Formatting with Formula

Step-by-Step Guide

To create Conditional Formatting using a formula, follow the steps below:

  • Go to the Home tab
  • Select Conditional Formatting > New Rule

  • In the dialog box, select: Use a formula to determine which cells to format

Conditional Formatting with Formula in Excel

  • Enter the formula in the formula box.

Conditional Formatting with Formula in Excel

  • Click on the Format button

Conditional Formatting with Formula in Excel

  • Choose an appropriate formatting

  • Click OK

Example 1: Highlight an Entire Row Based on One Column

In this example, you have to highlight an entire row if the status is Pending.

  • Select the entire data range

  • Go to Home > Conditional Formatting > New Rule

  • Select Use a formula to determine which cells to format

Conditional Formatting with Formula in Excel

  • Enter the formula: =$D2=”Pending”

  • Click on Format > Select the required fill color > Click OK

The entire row for an order with status pending will be highlighted.

Example 2: Highlight Overdue Dates

In this example, you have to highlight dates that have already passed.

  • Select the Due Data range

  • Go to Home > Conditional Formatting > New Rule

  • Select Use a formula to determine which cells to format

Conditional Formatting with Formula in Excel

  • Enter the formula: =B2<TODAY()

  • Click on Format > Select the required fill color > Click OK

Excel highlights any date that is earlier than today’s date.

Example 3: Highlight Repeat Entries Only

Excel already provides a built-in rule for highlighting duplicate values. However, formulas provide more control. It will highlight repeated entries and leave the first occurrence unchanged.

  • Select the Order ID range

  • Go to Home > Conditional Formatting > New Rule

  • Select Use a formula to determine which cells to format

Conditional Formatting with Formula in Excel

  • Enter the formula: =COUNTIF($A$2:A2,A2)>1

  • Click on Format > Select the required fill color > Click OK

Excel highlights the second or more occurrences.

 

Manage Conditional Formatting Rules

As you add more Conditional Formatting rules, it is important to manage them properly.

Go to Home > Conditional Formatting > Manage Rules

Here, you can create a new rule, edit an existing rule, or delete a rule.

  • Rule order – Excel checks rules from the top of the list downward. You can use the arrow keys to change the order of the rule.

  • Stop if True – Tick this box, and Excel stops checking any lower rules for a cell once this rule matches.

  • Applies to – This column shows the range covered by each rule.

 

FAQs

1. What is Conditional Formatting in Excel?

Conditional Formatting changes the format of cells when specific conditions are met.

2. Can I use a formula in Conditional Formatting?

Yes. You can use formulas to create custom formatting rules.

3. Can Conditional Formatting highlight an entire row?

Yes. A formula can highlight an entire row based on a value in one column.

4. How to edit a Conditional Formatting rule?

Go to Home > Conditional Formatting > Manage Rules and select the rule you want to edit.

5. Does Conditional Formatting update automatically?

Yes. Excel updates the formatting automatically when the cell values change.

If you like this Excel tip, please share it


Founder & Chief Inspirational Officer

at

John Michaloudis is a former accountant and finance analyst at General Electric, a Microsoft MVP since 2020, an Amazon #1 bestselling author of 4 Microsoft Excel books and teacher of Microsoft Excel & Office over at his flagship MyExcelOnline Academy Online Course.

See also  How to Calculate Standard Deviation in Excel: A Detailed Tutorial

Star 30 Days - Full Access Star

One Dollar Trial

$1 Trial for 30 days!

Access for $1

Cancel Anytime

One Dollar Trial
  • Get FULL ACCESS to all our Excel & Office courses, bonuses, and support for just USD $1 today! Enjoy 30 days of learning and expert help.
  • You can CANCEL ANYTIME — no strings attached! Even if it’s on day 29, you won’t be charged again.
  • You'll get to keep all our downloadable Excel E-Books, Workbooks, Templates, and Cheat Sheets - yours to enjoy FOREVER!
  • Practice Workbooks
  • Certificates of Completion
  • 5 Amazing Bonuses
Satisfaction Guaranteed
Accepted paymend methods
Secure checkout

Get Video Training

Advance your Microsoft Excel & Office Skills with the MyExcelOnline Academy!

Dramatically Reduce Repetition, Stress, and Overtime!
Exponentially Increase Your Chances of a Promotion, Pay Raise or New Job!

Learn in as little as 5 minutes a day or on your schedule.

Learn More!

Share to...