How to Count Colored Cells in Microsoft Excel
How to Count Colored Cells in Microsoft Excel
Using color in Microsoft Excel can be a terrific way to make data stand out. So if a time comes when you want to count the number of cells you’ve colored, you have a couple of ways to do it.
Maybe you have cells colored for sales amounts, product numbers, zip codes, or something similar. Whether you’ve manually used color to highlight cells or their text or you’ve set up a conditional formatting rule to do so, the following two ways to count those cells work great.
This first method for counting colored cells is the quickest of the two. It doesn’t involve inserting a function or formula, so the count will simply be displayed for you to see and record manually if you wish.
Select the cells you want to work with and head to the Home tab. In the Editing section of the ribbon, click “Find & Select” and choose “Find.”
When the Find and Replace window opens, click “Options.”
Known formatting: If you know the precise formatting you used for the colored cells, for example, a specific green fill, click “Format.” Then use the Font, Border, and Fill tabs in the Find Format window to select the color format and click “OK.”
Unknown formatting: If you’re not sure of the exact color or used multiple format forms like a fill color, border, and font color, you can take a different route. Click the arrow next to the Format button and select “Choose Format From Cell.”
When your cursor transforms to an eyedropper, move it to one of the cells you want to count and click. This will put the formatting for that cell into the preview.
Using either of the above two ways to enter the format you’re looking for, you should next check out your preview. If it looks correct, click “Find All” at the bottom of the window.
When the window expands to display your results, you’ll see the count on the bottom left as “X Cell(s) Found.” And there’s your count!
You can also review the exact cells in the bottom portion of the window, just above the cell count.
Count Colored Cells Using a Filter
If you plan to adjust the data over time and want to keep a cell dedicated to your colored cell count, this second method is for you. You’ll use a combination of a function and a filter.
Let’s start by adding the function, which is SUBTOTAL. Go to the cell where you want to display your count. Enter the following, replacing the A2:A19 references with those for your own range of cells, and hit Enter.
=SUBTOTAL(102,A2:A19)
The number 102 in the formula is the numerical indicator for the COUNT function.
Note: For other function numbers you can use with SUBTOTAL, take a look at the table on Microsoft’s support page for the function.
As a quick check to make sure you entered the function correctly, you should see a count of all cells with data as the result.
Now it’s time to apply the filter feature to your cells. Select your column header and go to the Home tab. Click “Sort & Filter” and choose “Filter.”
This places a filter button (arrow) next to each column header. Click the one for the column of colored cells you want to count and move your cursor to “Filter by Color.” You’ll see the colors you’re using in a pop-out menu, so click the color you want to count.
Note: If you use font color instead of or in addition to cell color, those options will display in the pop-out menu.
When you look at your subtotal cell, you should see the count change to only those cells for the color you selected. And you can pop right back up to the filter button and choose a different color in the pop-out menu to quickly see those counts too.
After you finish getting counts with the filter, you can clear it to see all of your data again. Click the filter button and choose “Clear Filter From.”
If you’re already taking advantage of colors in Microsoft Excel, those colors can come in handy for more than just making data stand out.