In Excel: there is no COUNTCOLOR function — filter by colour and use =SUBTOTAL(103, range), which counts only the visible rows.
On this page7
Select the range and turn on Data ▸ Filter.
Put =SUBTOTAL(103, range) in a cell above or below the data — 103 is COUNTA over visible rows only.
Click the filter arrow ▸ Filter by Colour and pick the fill you want counted.
Read the SUBTOTAL cell; switch colours in the filter to count a different one.
For a one-off count instead, press Ctrl+F ▸ Options ▸ Format ▸ Choose Format From Cell, click a coloured cell, then Find All and read the count in the dialog.
Better long-term: add a Status column holding the meaning, apply the colour with conditional formatting driven by that column, and count with a plain COUNTIF.
What this does
Excel has no worksheet function that can see a cell's fill. COUNTIF, COUNTA and SUMIF all read values, so no formula built from them can count by colour. Three approaches actually work. Filter by Colour plus SUBTOTAL is the one to reach for: SUBTOTAL with function number 103 counts only visible rows, so filtering the column by fill colour makes the count update as you switch colours. Find & Select ▸ Find with Format ▸ Find All reports the match count in the dialog for a one-off answer. And a short VBA function can read Interior.ColorIndex if you genuinely need it in a cell — at the cost of a macro-enabled workbook. The real lesson is that colour is formatting, not data: if a colour means something, put that meaning in its own column and count that instead. The same idea underpins a lot of everyday Excel work, so the few minutes spent getting it right here pay back across every sheet you build afterwards. Treat it as a pattern, not a one-off, and it stops being something you look up and starts being something you reach for. The difference between a quick fix and a sheet you can trust is the extra minute you spend validating “excel cell count by color”. Start on a copy or a tiny sample, keep the affected cells visible, and compare the result with the tool above before you touch the real workbook. When a formula is involved, keep the inputs labelled beside it, reference cells instead of typing values, and apply number formatting only after the result checks out. The point is a layout choice that keeps the sheet readable and sortable, but the practical win is that someone else can open the file and understand what happened without asking you.
A worked example
Status values in B2:B200, some filled amber. Put =SUBTOTAL(103, B2:B200) in B1. Turn on Data ▸ Filter, click the column's filter arrow ▸ Filter by Colour ▸ the amber swatch. B1 now reads 34 — the number of amber rows — and changes as you pick a different colour. Without the filter it reads 199, because SUBTOTAL only ignores rows the filter hid. For the one-off route: Ctrl+F ▸ Options ▸ Format ▸ Choose Format From Cell ▸ click an amber cell ▸ Find All, and the dialog footer reports "34 cell(s) found". Colour-coded trackers are everywhere and the first question anyone asks of one is "how many are red" — which is exactly the question Excel is worst at answering, and the reason to keep the meaning in a column. A practical tip before you scale it up: build it once on a small block of test data, confirm the number against the tool on this page, and only then point it at your real sheet. That one habit catches almost every mistake while it is still cheap to fix, long before a wrong figure reaches a report or a colleague.
In Google Sheets
Everything above works in Google Sheets too. Excel and Sheets share the formula syntax used here; only the surrounding menus are arranged differently. That portability is deliberate — learn it once and it follows you between the two tools and across Windows and Mac. Nothing on this page is behind a login or a download: the exact answer is at the top, and the detail below it is there for when you need it. That is the whole promise here — the answer first, and just enough context to make it stick. Treat “excel cell count by color” as a small building block rather than a chore. Once the inputs sit in their own cells and the formula reads from them, the same setup answers a dozen related questions with a tweak, and Excel keeps every dependent figure current as the data changes. The tool above is there so you can rehearse and verify before committing anything to a real workbook; the steps and worked example are there so the logic sticks. Get it right once and it stops costing you time — it starts saving it, every time the question comes back around.
Common mistakes
- Looking for a COUNTCOLOR or COUNTIFBYCOLOR function — none exists in any Excel version.
- Using
SUBTOTALwith 3 instead of 103: the 1–11 codes still count hidden-by-filter rows in some cases, while 101–111 always exclude them. - Expecting the count to refresh when you recolour a cell — fills are not a calculation input, so nothing recalculates until the filter is reapplied.
- Counting colours applied by conditional formatting with the Find-by-format route; it matches only manually applied fills, not rule-driven ones.
- Building a process on colour rather than on a value column, which no formula, PivotTable or filter can reliably read.
Frequently asked questions
How do I count coloured cells in Excel?
Filter the column by colour, then use =SUBTOTAL(103, range), which counts only visible rows. There is no built-in function that reads cell fill directly.
Is there a COUNTCOLOR function?
No. Excel has no worksheet function that can see formatting. The alternatives are Filter by Colour with SUBTOTAL, Find All with a format filter, or a VBA user-defined function.
How do I count cells coloured by conditional formatting?
Count the underlying condition instead, with COUNTIF or COUNTIFS. Conditional formatting colours are not stored on the cell, so neither Find-by-format nor VBA's Interior.ColorIndex sees them.
Why does my count not update when I change a colour?
Changing a fill is not a calculation event, so Excel does not recalculate. Reapply the filter, or press Ctrl+Alt+F9 to force a full recalculation.
Other ways people ask this
This is also commonly searched as “count cells by color excel”, “how to count cells in excel by color”, “count by cell color excel” and “how to count the cells in excel by color”. They describe the identical operation, so you are in the right place no matter how you phrased it.
Why do people search for this in so many different ways?
Because the same task has many names. “count cells by color excel”, “how to count cells in excel by color”, “count by cell color excel” all point at the one operation explained on this page, which is why they all lead here.