Reputation: 131
Is there a way/a function to count the number of color filled cells in Excel 2013 without using VBA? Something like
COUNTxxx(A1:A20)
Upvotes: 1
Views: 1691
Reputation: 897
Function CountColor(xRange As Range, xColor As Long) As Long
Dim xCell As Range
For Each xCell In xRange
If xCell.Font.ColorIndex = xColor Then
CountColor = CountColor + 1
End If
Next
End Function
Use this function in excel
=CountColor(A1:E25;3)
3 = Red
Upvotes: 1
Reputation: 306
Unfortunately, it is not possible to fulfill this task using only the Excel built-in function(s).
There are 2 ways:
You can find more details about the ways to count / sum colored cells, including the VBA code, in this blog post: How to count and sum cells by color in Excel
Upvotes: 2