How Do I COUNT Coloured Cells in Excel

If you just need to count coloured cells in excel 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.

On this page7
▤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

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. For “count coloured cells in excel”, the reliable version is a short checking loop, not just the first command that appears to work. Run it on a deliberately small range first, watch how the affected cells change, and only then apply the same setup to the full sheet. 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. That is what makes a layout choice that keeps the sheet readable and sortable useful in real work: repeatable, auditable, and not dependent on memory or luck.

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. Check the referenced cells, argument order and result type in your workbook. Start with the worked example before changing an input, then compare the changed result with the calculation you expected. An error value or a result of a different type is a reason to inspect the inputs and arguments.

In Google Sheets

Google Sheets support for this task has not been verified. Check the function, arguments and workflow in the target product before transferring the example. Matching formula notation does not establish identical behaviour. The aim was to get you unstuck fast and leave you a little more capable than a copy-paste would. The answer is at the top and the detail above shows why it holds — so the next time a colleague asks, you can answer without reaching for search. For “count coloured cells in excel”, keep the input cells and the result visible while you check the formula in Excel. Follow the worked example and change one input at a time. The steps explain the workbook calculation; this page does not run a live calculator for that task.

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.