Skip to Content

How do you do a 2 color scale conditional formatting formula?

Introduction

Conditional formatting is a useful feature in Excel that allows you to highlight cells based on certain criteria. With conditional formatting, you can quickly visualize data and see patterns, trends, and relationships. One type of conditional formatting in Excel is the 2 color scale, which shades cells in a range from one color to another based on the cell values.

For example, you may want to make cells with lower values red and cells with higher values green. The 2 color scale conditional formatting allows you to easily accomplish this in Excel. While you can apply the 2 color scale formatting directly through the Excel interface, you can also use a formula to define the formatting rules. Using a formula gives you more flexibility and control over the conditional formatting.

In this article, we will walk through how to create a 2 color scale conditional formatting rule using a formula in Excel. We will cover:

What is Conditional Formatting?

Conditional formatting in Excel allows you to format cells based on the values in the cells. For example, you may want to highlight cells that are greater than a certain value, or color code cells based on whether they are above or below average.

With conditional formatting, you can:

– Highlight cells that meet certain criteria with a fill color, font color, or border.

– Apply data bars, color scales, and icon sets to visualize values.

– Identify duplicate values, unique values, or values above or below average.

– Create rule-based formatting that will dynamically update when values change.

The advantage of conditional formatting is it allows you to quickly visualize data and see patterns and trends. Just a few clicks can highlight important information and draw the viewer’s eye to what matters most.

When to Use a 2 Color Scale Conditional Formatting Formula

A 2 color scale is useful when you want to color code cells based on their values within a relative range. For example, you may want to highlight:

– Highest and lowest values in a range differently.

– Values above and below average.

– Values above or below a threshold or goal.

– Grades on a test from low to high scores.

– Survey responses on a scale of 1 to 5.

– Any values from a min to a max within the same range.

The key is the 2 color scale shades cells proportionally between two colors based on where the cell value falls in the overall range. This helps viewers quickly visualize relative values and distributions in a range.

How to Apply a 2 Color Scale with Conditional Formatting Formula

Here are the steps to apply a two color scale conditional formatting rule with a formula:

1. Select the cells you want to format.

2. On the Home tab, click Conditional Formatting.

3. Select Color Scales and then the 2 Color Scale option.

4. In the menu, select “More Rules.”

5. In the New Formatting Rule dialog box, select “Use a formula to determine which cells to format.”

6. Enter this formula:

=IF($A1AVERAGE($A$1:$A$10),2))

7. Click the Format button and set the formats for each condition. For example:

– Condition 1: Set fill color to red.

– Condition 2: Set fill color to green.

8. Click OK to close the dialogs.

This formula checks if each cell is below or above the average and applies the red or green fill accordingly. The conditional formatting will automatically update when the values change. You can customize the formula for your own purposes.

Breaking Down the Formula

Here is a breakdown of each part of the 2 color scale conditional formatting formula:

`=IF($A1AVERAGE($A$1:$A$10),2))`

– `IF($A1AVERAGE($A$1:$A$10),2))` – The second IF statement is nested and checks if A1 is greater than the average. If true, it returns a 2.

– By returning 1 or 2, we define which formatting rule to apply. 1 = red fill for below average, 2 = green fill for above average.

You can reference any cell or range in the formula. The key is returning a 1 or 2 to define the formatting rules.

Customizing the Formula

You can customize the 2 color scale formula in many ways:

– **Compare to thresholds** – Instead of the average, compare to fixed values like =IF($A180,2))

– **Different ranges** – Reference any range for min, max, average =IF($A1MAX($B$1:$B$100),2))

– **More or less colors** – Add more values and rules for 3, 4 or 5 color scales

– **Non-adjacent ranges** – Reference two different ranges for min and max

– **Greater than OR equals** – Use >= and and Creating a 2 Color Scale Table Example

To see a 2 color scale in action, here is an example comparing sales data to average:

Region Sales
West $143,000
Central $185,000
East $126,000

We’ll apply conditional formatting to shade the Sales cells red or green based on being below or above the average:

1. Select the Sales cells B2:B4.

2. Click Conditional Formatting > Color Scales > 2 Color Scale.

3. Select “More Rules” and enter this formula:

=IF(B2AVERAGE($B$2:$B$4),2))

4. Set red fill for condition 1 and green for 2.

This will apply the red/green color scale to the sales figures based on their relation to the average. You can now instantly see that Central is above average and East is below average.

Additional Examples and Uses

A few more examples of using a 2 color scale conditional formatting formula:

– Grade exam scores from 0-100% red (low) to green (high)

– Temperature data from cold blue to hot red

– Survey ratings from disagree (red) to agree (green)

– Sales growth from negative (red) to positive (green)

– Product margins from low (red) to high (green)

– Any data where threshold values determine the color coding

The 2 color scale is applied proportionally across the full range, so it is best to use with contiguous ranges and numeric values. Dates can work as long as they are true date values and can be calculated properly.

Conclusion

The 2 color scale conditional formatting in Excel provides an effective way to visualize values within a range. By applying formatting rules based on a formula, you gain flexibility in comparing values to reference points like minimum, maximum, mean, or fixed values. The colors help viewers quickly grasp the relative relationships in the data.

Whether comparing to average, set thresholds, or min and max values, a 2 color scale formula tailors the formatting to your specific needs. Just remember to use logical checks for your reference points and return numbers matching your format rules. With some thoughtful formulas, you can color code any range for clearer insights.

Key Takeaways

– Use a 2 color scale to highlight high and low values in a range differently.

– Apply conditional formatting rules based on a formula for maximum flexibility.

– The formula should check values against reference points and return 1 or 2 to define the formats.

– Customize the formula by changing cell references, thresholds, operators, and number of rules.

– Add a visual like a table to demonstrate the color scale formatting.

With the techniques covered here, you should feel confident building 2 color scale formatting formulas to better visualize your Excel data.