How to Count Colored Cells in Excel

Excel has no normal COUNTCOLOR worksheet function because fill color is formatting, not a cell value. You can still count colored cells with Find and Replace for a quick snapshot or a named GET.CELL formula for a live-ish workbook method.

Does this affect you?

Use this for Excel for Microsoft 365, Excel 2021, and Excel 2019 on Windows or Mac when cells are colored to flag status and you need a count by fill color.

Count a color with Find and Replace

This is fastest when you only need the number once.

  1. Select the range to check.
  2. Press Ctrl+F.
  3. Click Options to expand the Find dialog.
  4. Next to Find what, click Format.
  5. Choose Choose Format From Cell and click a cell with the color you want counted.
  6. Click Find All.
  7. Read the match count at the bottom of the results panel.

This number is a snapshot. If you recolor cells later, repeat the search.

Count a color with a formula helper

This uses an older Excel macro function through a named formula.

  1. Open Formulas > Define Name.
  2. Create a name such as CellColor.
  3. In Refers to, enter =GET.CELL(63,INDIRECT(“rc”,FALSE)).
  4. In a helper column beside the colored cells, enter =CellColor and copy it down.
  5. Note the color code beside a cell with the target fill color.
  6. Use COUNTIF on the helper column, such as =COUNTIF(D2:D50,3), replacing 3 with the target color code.

More control

Save as macro-enabled when using GET.CELL

Because GET.CELL is a legacy macro function, save the workbook as .xlsm if you rely on the formula method. For one-time counts, Find and Replace avoids that requirement.

Color is fragile as data

If the color represents status, consider adding a real Status column and using color as a visual layer. Formulas and filters work more reliably with actual values.

Recalculate after color changes

Color-based helper formulas may not refresh instantly after changing only formatting. Force recalculation or edit a nearby value if the count seems stale.

Sources

  • Microsoft Support – Count values based on their fill color (2025)
  • Microsoft Support – Find and replace text or numbers (2025)
  • Microsoft Support – GET.CELL macro function reference (2024)
Disclosure: This post may contain affiliate links which means I may receive a commission for purchases made through links. I will only recommend products that I have personally used! Learn more on my Private Policy page.
A thoughtful woman reads a newspaper while enjoying coffee at an indoor workspace.

DEALWEEK

SUBSCRIBE AND GET 20% OFF YOUR NEXT ORDER! OFFER ENDS SOON - DON’T MISS OUT!

We don’t spam! Read our privacy policy for more info.

Shopping Cart