• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Microsoft Excel Tips and Tricks - Computergaga

  • Home
  • Excel Online Courses
  • Excel Functions List
  • Free Downloads
  • Blog
  • Tutorials
  • About
Home / Formulas / Conditional Formatting Multiple Columns – 3 Examples

Conditional Formatting Multiple Columns – 3 Examples

In this blog post, we will explore using Conditional Formatting with multiple columns. And we will run through three different examples of doing so.

Conditional Formatting is typically applied to one cell, or column. It evaluates the cells in that range, and also applies the formatting to that same range.

In this blog post though we take things further to see example of testing and formatting multiple columns.

Using the AND Function with Conditional Formatting

In this first example we want to apply a Conditional Formatting to the data set below.

The dataset that the article will use. A list of quartely sales.

We want to format the row if every value in columns B, C, D and E is greater than or equal to 100.

  1. Select the range of cells you want to format (B2:E7 in this scenario).
  2. Click Home > Conditional Formatting > New Rule.
  3. Select the Use a formula to determine which cells to format option.
  4. Enter the formula below into the box provided.
=AND($B2>=100,$C2>=100,$D2>=100,$E2>=100)
The AND function used in a Conditional Formatting feature.

The column are made absolute in the formula so that it does not move to each cell when we copy it to the right.

Click the Format button and choose what formatting you would like.

The finished article looks like below. Two of the persons met this target.

The completed Conditional Formatting rule with the AND function.

Testing a Threshold Value in a Another Cell

In this example, we would like to format the row if any one of the cells has a value greater than or equal to the value in another cell.

In the data below, we have a threshold value in cell G3 which we would like to test against. The Conditional Formatting rule from the previous example is also still applied.

Sample data of quarterly sales and that has a threshold value entered in cell G3.

Because we are hoping to apply the formatting if any one of the cells is true – we will use the OR function.

Follow the steps from the previous example to create a new rule and enable us to enter a formula.

We will use the following formula. The reference to cell G3 is absolute.

=OR($B2>=$G$3,$C2>=$G$3,$D2>=$G$3,$E2>=$G$3)
OR function within a Conditional Formatting rule to test if at least one values meets our condition.

The rule is applied to the dataset.

Threshold Conditional Formatting rule applied.

You can see that an additional row has been formatted, but it has also overwritten one of the rows from the previous example (Joseph).

Now, the previous rule was more important than this one. So we need to change the order of the rules so that if they are both true, then the rule with the AND function has priority.

Click on one of the values in the range and click Home > Conditional Formatting > Manage Rules.

Use the arrows as indicated in the image below to change the order of the rules so that the AND function is on top. The higher in the list, the greater the priority.

Changing the order of Conditional Formatting rules

Now this is what we wanted.

Conditional Formatting rules applied in the correct order.

And if the value in cell G3 is changed. the Conditional Formatting rule will react to this.

More Than Two Columns Meet Criteria

In this final example, we would like to apply the Conditional Formatting rule if more than 2 of the columns have values of 100 or more.

We will use the COUNTIF function for this.

This function can count how many cells contain a value of 100 or more. And then we can test if the answer to that is more than two.

Follow the steps from the previous examples to create a new Conditional Formatting multiple columns rule using a formula.

The formula below can be used.

=COUNTIF($B2:$E2,">=100")>2
Using the COUNTIF function with Conditional Formatting

The rule is applied to the data range. The previous rules have been removed.

Formatting when more than two column meet criteria.

In this blog post we looked at three different examples of how and why to test multiple columns with Conditional Formatting.

I hope it has given you some ideas where you might be able to apply similar techniques.

Related Posts:

  • Stop PivotTable Columns Resizing feature
    Stop PivotTable Columns Resizing
  • Return non-adjacent columns FILTER function thumbnail
    Non-Adjacent Columns with FILTER Function

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Recent Posts

  • Excel SWITCH Function – Nested IF Function Alternative
  • Sum Formulas Only in Excel
  • How to Calculate Age in Excel
  • Custom Sort in Excel
  • Case Sensitive Lookup with XLOOKUP in Excel
Advanced Excel Success book

Footer

Contact

[email protected]

LinkedIn Twitter YouTube

Useful Links

  • Home
  • Excel Online Courses
  • Tutorials
  • Sitemap
  • Privacy Policy
  • Jobs by Jooble

Course Topics

  • Blog
  • Charts
  • Courses
  • Dashboards
  • Downloads
  • Excel Tips
  • Formulas
  • Mail Merge
  • Office
  • PivotTables
  • Power BI
  • Power Pivot
  • Power Query
  • VBA

Join Our Mailing List

© Copyright 2009 Computergaga · All Rights Reserved ·