How to Chart Conditionally Formatted Cell Colors in Excel
Question details
The user wants to create a chart based on the total count of cells that are colored red or green by conditional formatting.

- Product
- Spreadsheet
- Device & OS
- not provided
- Scenario
- Creating a bar or pie chart from data that relies on conditional formatting rules, where native charting tools cannot directly read the visual cell color.
- Observed behavior
- Spreadsheet charts cannot directly count or visualize cell colors applied via conditional formatting, requiring a logical workaround to summarize the data first.
Identify the exact logical conditions (such as values > 100 or specific text matches) that trigger your current red and green conditional formatting, as you will need to replicate this logic in a formula.
Use a Helper Column and COUNTIF Function
Create a dedicated status column to evaluate the underlying condition, then count these statuses to build your chart.
Because charts only read values and ignore formatting, the most reliable method is to translate the formatting rule into a text value using a helper column.
Insert a new column next to your data. Use an IF formula (e.g., =IF(A2>100,"Green","Red")) to output the status for each row.
To keep things organized, you can base your cell coloring on this new status column containing the words 'Red' or 'Green'.
In a blank area of your spreadsheet, use the COUNTIF function to tally the statuses. For example, enter =COUNTIF(StatusRange,"Red") in one cell and =COUNTIF(StatusRange,"Green") in another.
Select your newly created summary counts and category labels, then go to the Insert tab and click Chart to generate a bar or pie chart.

Easily Chart Conditionally Formatted Data in WPS Spreadsheet
WPS Office provides powerful formulas and intuitive charting tools to quickly summarize and visualize conditionally formatted data without hassle.
- 1. Open your workbook: Launch WPS Spreadsheet and open the document containing your conditionally formatted data.
- 2. Insert an IF formula: Create a helper column and write an IF statement to assign text values like 'Red' or 'Green' based on your data criteria.
- 3. Count the results: Set up a small summary table and use the COUNTIF function to count the occurrences of each text value.
- 4. Insert the chart: Highlight the summary table, navigate to the Insert tab on the top ribbon, and click Chart to generate your visual representation.

Frequently Asked Questions
Can I count cells directly by their background color without a helper column?
Standard spreadsheet formulas cannot directly count cells by background color, especially if the color is applied via conditional formatting. You must use a helper column to evaluate the condition or rely on advanced VBA macros.
How do I use a PivotTable instead of COUNTIF to chart the data?
After creating your helper status column, select your data range and go to Insert > PivotTable. Drag the status field into both the 'Rows' and 'Values' areas to get a count, then insert a PivotChart based on this table.
Why does my chart not update when the conditional formatting changes?
If your chart is linked to the summary table (using COUNTIF or a PivotTable), ensure your helper column correctly mirrors the conditional formatting rules. Note that PivotTables require a manual refresh (Right-click > Refresh) when underlying source data changes.




