Skip to main content

Conditional formatting stacked bar chart in Excel

Author: Sun Last Modified: 2024-10-28

This tutorial, it introduces how to create conditional formatting stacked bar chart as below screenshot shown step by step in Excel.
Conditional formatting stacked bar chart


Conditional formatting stacked bar chart

1. Create helper columns firstly. Select a cell next to you data, type this formula =(B2/SUM($B2:$D2))*100, B2 is the cell you want to calculate its percentage in Project A, B2:D2 contains three parts of the Project A. then drag.
apply a formula to create a helper column

2. Then drag AutoFill handle over all cells to calculate the percentage of each value.
drag AutoFill handle over all cells to calculate the percentage of each value

3. Now start creating the conditional formatting stacked bar. Select 100 column ranges next to the formula cells, supposing J2:DE5, click Home > Format > Column Width, and adjust the column width to 0.1, and click the OK button.
click Home > Format > Column Width
adjust the column width to 0.1

4. Keep the columns selected, and click Home > Conditional Formatting > New Rule.
click Home > Conditional Formatting > New Rule

5. In the New Formatting Rule dialog, select Use a formula to determine which cells to format from the Select a Rule Type section, then type this formula =COLUMNS($J$2:J2)<=$F2 into Format values where this formula is true text box.
specify the options in the dialog box

Note: J2 is the first cell that in the selected column ranges. F2 is the first formula cell.

6. Click Format to the Format Cells dialog, under Fill tab, select one color. Click OK > OK to close the dialog.
select one fill color

7. Then apply the conditional formatting at the second time.

(1) In the New Formatting Rule dialog, select Use a formula to determine which cells to format from the Select a Rule Type section, type this formula =AND(COLUMNS($J$2:J2)>$F2,COLUMNS($J$2:J2)<=($F2+$G2)) into Format values where this formula is true text box, and click Format.

(2) Then in the Format Cells dialog, under Fill tab, select one color.

(3) Click OK > OK to close the dialogs.
apply another formula in the New Formatting Rule dialog

8. Lastly, apply the conditional formatting at the third time.

(1) In the New Formatting Rule dialog, select Use a formula to determine which cells to format from the Select a Rule Type section, type this formula =AND(COLUMNS($J$2:J2)>($F2+$G2),COLUMNS($J$2:J2)<=100) into Format values where this formula is true text box, and click Format.

(2) In the Format Cells dialog, under Fill tab, select one color.

(3) Click OK > OK to close the dialog.
apply the third formula in the New Formatting Rule dialog

Now the stacked bar chart with conditional formatting have been created.
the stacked bar chart with conditional formatting have been created

You can add borders around them for well-look.
add borders around them for well-look

a screenshot of kutools for excel ai

Unlock Excel Magic with Kutools AI

  • Smart Execution: Perform cell operations, analyze data, and create charts—all driven by simple commands.
  • Custom Formulas: Generate tailored formulas to streamline your workflows.
  • VBA Coding: Write and implement VBA code effortlessly.
  • Formula Interpretation: Understand complex formulas with ease.
  • Text Translation: Break language barriers within your spreadsheets.
Enhance your Excel capabilities with AI-powered tools. Download Now and experience efficiency like never before!

Sample File

Click to download the sample file

Other Operations (Articles) Related To Conditioanl Formatting

Count/sum cells by colors with conditional formatting in Excel
Now this tutorial will tell you some handy and easy methods to quickly count or sum the cells by color with conditional formatting in Excel.

create a chart with conditional formatting in Excel
For example, you have a score table of a class, and you want to create a chart to color scores in different ranges, here this tutorial will introduce the method on solving this job.

Search and highlight search results in Excel
In Excel, you can use the Find and Replace function to find a specific value, but do you know how to highlight the search results after searching? In this article, I introduce two different ways to help you search and highlight search results at the meanwhile in Excel.

Conditional formatting rows or cells if two columns equal in Excel
In this article, I introduce the method on conditional formatting rows or cells if two columns equal in Excel.

Apply conditional formatting for each row in Excel
Sometimes, you may want to apply the conditional formatting for per row. Except repeatedly setting the same rules for per row, there are some tricks on solving this job.


  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns and Keeping Data; Split Cells Content; Combine Duplicate Rows and Sum/Average... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Favorite and Quickly Insert Formulas, Ranges, Charts and Pictures; Encrypt Cells with password; Create Mailing List and send emails...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • Pivot Table Grouping by week number, day of week and more... Show Unlocked, Locked Cells by different colors; Highlight Cells That Have Formula/Name...
kte tab 201905
  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
officetab bottom