Excel COUNT by Color

If you just need to excel count by color and move on, the boxed answer at the top is all you need. The rest of this page is for when you want to understand why it works in Excel, adapt it to a trickier version, or make it robust enough to hand to a colleague. We keep the opening short on purpose — the depth is here when you want it, not in your way when you don’t.

Exact answer

In Excel: there is no COUNTCOLOR function — filter by colour and use =SUBTOTAL(103, range), which counts only the visible rows.

Annotated stepsExcel
1

Select the range and turn on Data ▸ Filter.

2

Put =SUBTOTAL(103, range) in a cell above or below the data — 103 is COUNTA over visible rows only.

3

Click the filter arrow ▸ Filter by Colour and pick the fill you want counted.

4

Read the SUBTOTAL cell; switch colours in the filter to count a different one.

5

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.

6

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.

=SUBTOTAL(103,B2:B200)
Ctrl+CthenCtrl+Shift+V+Cthen+Ctrl+VPaste values · WindowsMac

Need it as an auditable file?

Ships inside the linked template — formula-driven, unlocked, audit-ready.

View template

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. Most people learn this as a sequence of clicks and forget it by next week; learning it as a pattern instead is what lets you apply it to the next, slightly different version of the problem without starting from scratch. That is the difference this page is trying to make. The difference between a quick fix and a sheet you can trust is the extra minute you spend validating “excel 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 calculation you can defend to a CFO or an auditor, 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

If you are in Google Sheets rather than Excel, the good news is that the formula shown here is identical and the workflow barely changes — menus sit across the top instead of in a ribbon, and a few function names differ slightly, but anything you build here moves across with little or no rework. Keep this page bookmarked for the next time the same question comes up. Better still, rebuild the example once in your own sheet — doing it yourself, with the tool above to check against, is what turns a copied formula into a technique you own. The short version of “excel count by color”: the answer is at the top of this page, the tool proves it on your own numbers, and the sections above explain why it holds so the next variation does not stump you. Excel rewards people who reference cells instead of typing values and who keep inputs separate from formulas, because that is what makes a result you can audit months later. Build it once, deliberately, with the live tool as a check, and you convert a one-off lookup into a reusable skill — which is the whole point of learning the why and not just the what.

Common mistakes

  • Looking for a COUNTCOLOR or COUNTIFBYCOLOR function — none exists in any Excel version.
  • Using SUBTOTAL with 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.