Sum and count cells by font color in Google Sheets
Updated November 7, 2026
Sometimes the color is in the text, not the cell: overdue amounts in red, confirmed ones in green. Google Sheets has no function that sums or counts by font color, but you can filter by text color, or use SUMBYFONTCOLOR and COUNTBYFONTCOLOR from Cellhue.
Without an add-on: filter by text color
- Choose Data → Create a filter.
- Click the filter icon in the column header, then Filter by color → Text color, and pick the color.
- Outside the filtered rows, use
=SUBTOTAL(109, B2:B50)to sum or=SUBTOTAL(103, B2:B50)to count the visible cells.
This shows one color at a time and the result depends on the current filter.
With Cellhue: SUMBYFONTCOLOR and COUNTBYFONTCOLOR
=SUMBYFONTCOLOR(B2:B50, "#ff0000")
=COUNTBYFONTCOLOR(A:A, "#ff0000")
=SUMBYFONTCOLOR(B2:B50, D1)
- The color is a code like
"#ff0000"or a sample cell likeD1; Cellhue uses that cell's font color. SUMBYFONTCOLORadds numbers only.COUNTBYFONTCOLORcounts every cell with that text color.- In the sidebar, switch to Font color, select a range and click Analyze selection to see every text color in it with count, sum and average.
- Font color formulas are part of Cellhue Pro ($19 one-time payment), which also removes the 1,000-cell limit and adds auto-refresh while the sidebar is open.
Which red is my red?
The default Sheets "red" text is #ff0000, but the palette has several reds (#e06666, #cc0000, #990000 and more), and each counts as its own color. If a total looks too small, run Analyze selection in Font color mode: it lists every color actually used, so you can see whether two similar reds are mixed. Pointing to a sample cell like D1 also avoids typing the code.
Common questions
Can I count by fill color and font color together?
Each formula checks one kind of color. Use COUNTBYCOLOR for fill and COUNTBYFONTCOLOR for text, in separate cells.
Does it see text colored by conditional formatting?
No, only the font color set on the cell. For rule-based colors, use SUMIF or COUNTIF with the rule's condition.
Working with cell fill colors? See sum by color and count colored cells.
Try Cellhue
Color formulas that work like SUM and COUNTIF, a sidebar that shows every color in a range, and refresh when colors change. Free plan for fill colors; Pro is a $19 one-time payment.