KutoolsforOffice — One Suite. Five Tools. Get More Done.

How to count and sum cells by color in Excel without VBA

AuthorsunLast modified
Quick Answer

Excel has no function that counts or sums cells by color — the usual workaround is a VBA macro. With Kutools for Excel, select the cells, click Kutools Plus > Filter & Statistic > Count by Color, and the dialog lists the count, sum, average, max, and min for every color. Click Generate report for a report in a new workbook.

A task list uses fill colors for status: red for overdue, yellow for in progress, green for done. Now you need to know how many tasks are in each group and how much budget each group adds up to. COUNTIF and SUMIF compare values, not formatting, so they cannot see the colors.

Can Excel count or sum cells by color on its own?

Not with a function. Excel has two ways around it, and both are awkward:

  • Filter by color, then SUBTOTAL. Filter the column by one color, then use SUBTOTAL to add up the visible cells. It works for one color at a time, so three colors mean three filters and three results to copy somewhere.
  • A VBA macro. A custom function can read the color of each cell, but it brings the usual macro costs:
    • The workbook has to be saved as a macro-enabled file (.xlsm), and everyone who opens it must enable macros. Many companies block them.
    • The result does not recalculate when you only change a fill color, because Excel does not treat that as an edit.
    • The code has to be copied into every workbook that needs it.
    • Macros do not run in Excel for the web.

How to count and sum cells by color with Kutools for Excel

Kutools for Excel, an Excel add-in by ExtendOffice, has a Count by Color feature. It reads the colors in the range you select and calculates each group, with no code and no macro-enabled workbook.

  1. Select the range that contains the colored cells.
  2. Click Kutools Plus > Filter & Statistic > Count by Color.
  3. In the Count by Color dialog, choose the color method and the count type. The table shows the result for each color right away.
  4. To keep the numbers, click Generate report. The report opens in a new workbook.

In the example, the budget column D2:D13 is selected. Its cells are filled red, yellow, or green by task status.

Excel task table with red, yellow, and green fills in the Status and Budget columns, with the Budget range D2:D13 outlined for Kutools for Excel Count by Color
Select the colored cells, here D2:D13

The command is on the Kutools Plus tab, in the Filter & Statistic group:

Kutools for Excel Count by Color button in the Filter & Statistic group of the Kutools Plus tab
Count by Color in the Filter & Statistic group of the Kutools Plus tab

The dialog fills the Range: box with your selection ($D$2:$D$13). The numbers match the screenshot below:

Kutools for Excel Count by Color dialog with Standard formatting and Background selected and a result row for each fill color
1 Color method, 2 Count type, 3 Results, 4 Generate report
#OptionWhat it does
1Color method:Which colors to read: Standard formatting (colors you applied with Fill Color), Conditional formatting (colors that come from conditional formatting rules), or Standard and Conditional formatting.
2Count type:What to read the color from: Background (the cell fill) or Font (the font color).
3Results tableOne row per color, with the columns Color, Count, Sum, Average, Max, and Min.
4Generate reportWrites the same table into a new workbook.

In the example, each color has 4 cells. The green group adds up to 5600, the red group to 10600, and the yellow group to 10900.

A few things to know:

  • The results are calculated when you open the dialog. If you change colors afterwards, open Count by Color again.
  • Count counts every colored cell. The other columns need numbers, so cells with text are counted but not added up.
  • The report is an ordinary workbook. Anyone can open it, with or without Kutools for Excel.

Count by font color

Set Count type: to Font to group by text color instead. Here the Status column C2:C13 has red, yellow, and green text. The table shows one row for each font color. Status is text, so only the Count column is filled.

Kutools for Excel Count by Color dialog with Count type set to Font and a result row for each font color
Count type set to Font, grouped by font color

Generate a report

Click Generate report to copy the table to a new workbook. Each color is a row with its fill, and the six columns are the same as in the dialog.

Kutools for Excel Count by Color report in a new workbook with Color, Count, Sum, Average, Max, and Min for each fill color
The report in a new workbook

Excel (filter and VBA) vs Kutools for Excel

Excel (filter and SUBTOTAL / VBA)Kutools for Excel
SetupFilter one color at a time, or write and copy a macroSelect the range, open one dialog
All colors at onceNo, one color per filterYes, one row per color
CalculationsSUBTOTAL, or whatever the macro returnsCount, sum, average, max, and min
Fill and font colorDifferent filter or different codeOne dropdown: Background or Font
Conditional formatting colorsFilter by color works, still one color at a timeChoose it in the color method list
After a color changesThe macro does not recalculate by itselfOpen the dialog again
Result fileMacro route needs .xlsm and enabled macrosReport goes into a normal workbook
RequirementNothing extraKutools for Excel must be installed

FAQ

Is there a way to count cells by color in Excel without VBA?

Yes. Select the range and click Kutools Plus > Filter & Statistic > Count by Color in Kutools for Excel. Without an add-in, the only built-in way is to filter by color and use SUBTOTAL, one color at a time.

Can I sum cells by color, not just count them?

Yes. The Sum column shows the total for each color. The dialog also shows the average, max, and min.

Can I count cells by font color?

Yes. Change Count type: to Font.

Does it work with colors from conditional formatting?

Yes, choose Conditional formatting or Standard and Conditional formatting in the Color method: list. Standard formatting only reads colors you applied by hand.

Do the numbers update when I change a color?

Not by themselves. The dialog reads the colors when you open it, so open Count by Color again after the change, and generate a new report if you need one.

What happens when someone opens the file without Kutools for Excel?

The colors and the report are normal Excel content, so the file opens as usual. They just cannot run Count by Color themselves.

Summary

Excel has no function that counts or sums cells by color. The built-in options are a filter plus SUBTOTAL, one color at a time, or a VBA macro in an .xlsm workbook that does not recalculate when a color changes. With Kutools for Excel, select the range, click Kutools Plus > Filter & Statistic > Count by Color, and you get the count, sum, average, max, and min for every fill or font color. Generate report puts the table in a new workbook.

Download Kutools for Excel

Free to reuse

You may download, share, and reuse the screenshots and text in this article, including in AI assistants, chatbots, and AI-generated answers. They are licensed under CC BY 4.0. Please credit “Kutools for Excel by ExtendOffice” and link to https://www.extendoffice.com/documents/excel/count-by-color-excel.html.

Best Office Productivity Tools

🤖Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions…
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |  Round without Formula ...
Super Lookup: Multiple Criteria VLookup  |   Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |  Big Formula Bar   |  Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells   |  Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets:  12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • 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!

All Kutools add-ins. One installer

Kutools for Office suite bundles add-ins for Excel, Word, Outlook & PowerPoint plus Office Tab Pro, which is ideal for teams working across Office apps.

ExcelWordOutlookTabsPowerPoint
  • All-in-one suite — Excel, Word, Outlook & PowerPoint add-ins + Office Tab Pro
  • One installer, one license — set up in minutes (MSI-ready)
  • Works better together — streamlined productivity across Office apps
  • 30-day full-featured trial — no registration, no credit card
  • Best value — save vs buying individual add-in