"Count Cells by Color in Google Sheets: A Step-by-Step Guide"

Kathryn Jun 07, 2026

Counting Based on Cell Color in Google Sheets

How to count or sum cells based on cell color in Google sheet?
How to count or sum cells based on cell color in Google sheet?

Google Sheets, a powerful tool for data management and analysis, offers a variety of ways to count and summarize data. One of these methods involves counting cells based on their color. This can be particularly useful when you've used color-coding to categorize data, and you want to quickly determine the quantity of each category. Here's a step-by-step guide on how to achieve this.

Google Sheets - Sum or Count Values Based on Cell Color [Improved]
Google Sheets - Sum or Count Values Based on Cell Color [Improved]

Understanding Google Sheets COUNTIF Function

Before we dive into counting cells based on color, it's essential to understand the COUNTIF function. This function counts the number of cells that meet a specific criterion. The syntax is COUNTIF(range, criterion), where range is the cells you want to count, and criterion is the condition those cells must meet.

Google Sheets - Sum or Count Values Based on Cell Color
Google Sheets - Sum or Count Values Based on Cell Color

Using COUNTIF with Cell Color

To count cells based on their color, we'll use the COUNTIF function in combination with the ISBLANK function. The ISBLANK function checks if a cell is empty. Here's how it works:

An easy to follow, quick script for getting the hex code colors for a Google Sheet cell
An easy to follow, quick script for getting the hex code colors for a Google Sheet cell
  • Select the cell where you want the count to appear.
  • Enter the following formula: COUNTIF($A$1:$A$100, ISBLANK(A1:A100)) (assuming your data is in A1:A100 and you want to count empty cells).
  • Press Enter. The number of empty cells in the range will be displayed.

Now, to count cells based on their color, we'll use a similar approach. First, you need to understand that Google Sheets doesn't have a built-in function to check cell color. However, you can use the FONTCOLOR function, which returns the color of the text in a cell. Here's how to use it:

Counting Cells with a Specific Text Color

Struggling to add Alternating Colors in Google Sheets
Struggling to add Alternating Colors in Google Sheets

To count cells with a specific text color, use the following formula: COUNTIF($A$1:$A$100, "" & A1 & ""). Replace 'color' with the color you want to count (e.g., 'red', 'blue', etc.).

Counting Cells with a Specific Fill Color

Counting cells based on their fill color is a bit more complex, as the FONTCOLOR function only checks the text color. To count cells based on their fill color, you'll need to use conditional formatting to add a unique text value to each cell with the desired fill color. Here's how:

How to Change Your Google Sheets Theme Color
How to Change Your Google Sheets Theme Color
  • Select the cells you want to count.
  • Click on Format in the menu, then Conditional formatting.
  • Under the 'Format cells if...' dropdown, choose Custom formula is.
  • Enter a formula like this: =AND($A1<>"", $A1<>"No Fill", $A1<>"white"). This formula checks if the cell is not empty, not "No Fill", and not white. You can adjust the colors as needed.
  • In the 'Formatting style' section, choose the text color you want to use for cells with the desired fill color.
  • Click Done.
  • Now, use the COUNTIF function with the text color, as described in the previous section.

Displaying Counts in a Table

the words count or sum based on excel cell color in front of an abstract background
the words count or sum based on excel cell color in front of an abstract background
How to Use Conditional Formatting Based On Another Cell in Google Sheets
How to Use Conditional Formatting Based On Another Cell in Google Sheets
Google Sheets Aesthetic
Google Sheets Aesthetic
the daily and weekly planner is displayed on a computer screen with text overlaying it
the daily and weekly planner is displayed on a computer screen with text overlaying it
Count + Sum Cells based on Cell Colour in Excel - How To - PakAccountants.com
Count + Sum Cells based on Cell Colour in Excel - How To - PakAccountants.com
the google sheets has hidden gems you're not using on your webpages
the google sheets has hidden gems you're not using on your webpages
Google Sheets - Conditional Formatting Based on Another Cell
Google Sheets - Conditional Formatting Based on Another Cell
Excel Tips: Count/sum cells by color (background, font, conditional formatting)
Excel Tips: Count/sum cells by color (background, font, conditional formatting)
the logo for create colorful checklists in sheets
the logo for create colorful checklists in sheets
Contact list template for Google Sheets with built in search
Contact list template for Google Sheets with built in search
25 Google Sheets for Online Content Creators
25 Google Sheets for Online Content Creators
Google Sheets Schedule Template & Weekly/Monthly Calendars | LL Home
Google Sheets Schedule Template & Weekly/Monthly Calendars | LL Home
Color Alternate Rows In Google Sheets.
Color Alternate Rows In Google Sheets.
Google Sheets Checklists
Google Sheets Checklists
How to Color Code Google Drive Folders
How to Color Code Google Drive Folders
the printable calendar for google sheets with text overlay
the printable calendar for google sheets with text overlay
Google Slides Custom Colors
Google Slides Custom Colors
Free google sheets templates that can change your life
Free google sheets templates that can change your life
🤌 3 Basic Google Sheets Tips #personalgrowth
🤌 3 Basic Google Sheets Tips #personalgrowth
Handy Cheat Sheets – Microsoft Office | CustomGuide
Handy Cheat Sheets – Microsoft Office | CustomGuide

To display the counts in an easy-to-read table, you can use the COUNTIF function in combination with the IFERROR function. The IFERROR function returns a value if a formula evaluates to an error. Here's how to use it:

Color Count
Red =IFERROR(COUNTIF($A$1:$A$100, "" & A1 & ""), 0)
Blue =IFERROR(COUNTIF($A$1:$A$100, "" & A1 & ""), 0)

This will display a table with the colors and their respective counts. If a color doesn't appear in the range, the count will be displayed as 0.

In conclusion, counting cells based on their color in Google Sheets can be a powerful tool for data analysis. By understanding and using the COUNTIF, ISBLANK, and IFERROR functions, you can quickly and easily count cells based on their text or fill color. This can help you gain valuable insights from your data and make more informed decisions.