How do you conditionally format a bar graph in Excel?

How do you conditionally format a bar graph in Excel?

MORE RESOURCES
FOR MICROSOFT EXCEL

How do you conditionally format a bar graph in Excel?

This page is an advertiser-supported excerpt of the book, Power Excel 2010-2013 from MrExcel - 567 Excel Mysteries Solved. If you like this topic, please consider buying the entire e-book.

Problem: I want the chart column to be green for ratings of 90 or above, yellow for 70 to 90 and red for less than 70. Can I do conditional formatting in a chart?

How do you conditionally format a bar graph in Excel?

  1. Color the columns based on their value.

    Strategy: Charts don't support conditional formatting (yet). However, you can use formulas to separate your data into three series, one series for red, one series for yellow, and one series for green. Only one series will be filled for each category. The other series will be #N/A.

    The formulas below break the value in column B into one of three series in D, E, or F. Each value in B goes to exactly one cell in D:F.

    How do you conditionally format a bar graph in Excel?

  2. Formulas break the data into three series.

    The formulas used to create the table above are shown below.

    How do you conditionally format a bar graph in Excel?

  3. IF statements decide which color to use.

    When you create the chart, create a stacked column chart. You will have to select each series and use Format, Shape Fill to choose the correct color.

    If you need one color for positive and another color for negative, you can use a regular column chart. Format the series. On the Fill category, choose Invert if Negative. you can choose Green for the first color and red for the second color.

    How do you conditionally format a bar graph in Excel?

  4. This is new (back) in Excel 2010.

For example, you have a score table of a class, and you want to create a chart to color scores in different ranges, such as greater than 90, less than 60, and between 60 and 90 as below screenshot shown, how could you handle it? This article will introduce a way to create chart with conditional formatting to solve it.

How do you conditionally format a bar graph in Excel?

Create a chart with conditional formatting in Excel

To distinguish scores in different ranges in a chart, you can create the chart with conditional formatting in Excel.

1. Add three columns right to the source data as below screenshot shown:
(1) Name the first column as >90, type the formula =IF(B2>90,B2,0) in the first blank cell of this column, and then drag the AutoFill Handle to the whole column;
(2) Name the second column as <60, type the formula =IF(B2<60,B2,0), and drag the AutoFill Handle to the whole column;
(3) Name the third column as 60~90, type the formula =IF(AND(B2>=60,B2<=90),B2,0), and drag the AutoFill Handle to the whole column.

How do you conditionally format a bar graph in Excel?

Now you will get a new source data as below screenshot shown:

How do you conditionally format a bar graph in Excel?

2. Please select the Name column and the new three columns with holding the Ctrl key, and then click Insert > Insert Column or Bar Chart (or Column) > Clustered Column. See screenshot:

How do you conditionally format a bar graph in Excel?

Now a chart with conditional formatting is created. You will see the scores greater than 90 are blue, the scores less than 60 are orange, while the scores between 60 and 90 are gray. See screenshot:

How do you conditionally format a bar graph in Excel?

Create a chart with conditional formatting by an amazing tool

If you have Kutools for Excel installed, you can use its Color Grouping Chart feature to quickly create a chart with conditional formatting in Excel.

Kutools for Excel- Includes more than 300 handy tools for Excel. Full feature free trial 30-day, no credit card required! Get It Now

1. Select the data source you will create the chart based on, and click Kutools > Charts > Color Grouping Chart to enable this feature.

2. In the Color Grouping Chart, please do as follows:

How do you conditionally format a bar graph in Excel?

(1) Tick the Column Chart option; (2) Specify the range of the axis labels; (3) Specify the range of the series values;

(4) In the Group section, please click the Add button. Then in the Add a group dialog, please specify the group name, data range, and the certain range values as you need, and click the Add button.


Tips: This feature will add a conditional formatting rule by one group. If you need to add multiple conditional formatting rules for the chart, please add as many groups as you need.

3. Click the Ok button.

Now you will see a column chart is created, and columns are colored based on the specified groups.

How do you conditionally format a bar graph in Excel?

Notes: When you change the values in the data source, the fill color of corresponding columns will be changed automatically based on the specified groups.

Conditional formatting an existing chart

Sometimes, you may have created a column chart as below screenshot shown, and you want to add conditional formatting for this chart now. Here, I will recommend the Color Chart by Value feature of Kutools for Excel to solve this problem.

Kutools for Excel- Includes more than 300 handy tools for Excel. Full feature free trial 30-day, no credit card required! Get It Now

How do you conditionally format a bar graph in Excel?

1. Select the chart you want to add conditional formatting for, and click Kutools > Charts > Color Chart by Value to enable this feature.

2. In the Fill chart color based on dialog, please do as follows:
(1) Select a range criteria from the Data drop-down list;
(2) Specify the range values in the Min Value or Max Value boxes;
(3) Choose a fill color from the Fill Color drop-down list;
(4) Click the Fill button.

How do you conditionally format a bar graph in Excel?

Tips: (1) The (1)-(4) operations will change the fill color of columns whose data point values fall in the specified data range. (2) If you want to change the fill color of other columns, you need to repeat (1)-(4) operations to create other rules, says change the fill color of columns whose data point values are between 60 and 90 to gray.

How do you conditionally format a bar graph in Excel?

3. After finishing the operations, please click the Close button to quit the feature.

Notes: This method will solidly change the fill color of columns in the chart. If you change the values in the source data, the corresponding columns’ fill colors will not be changed.

Related articles:

Create a bell curve chart template in Excel

Break chart axis in Excel

No ratings yet. Be the first to rate!