是否有一种方法/功能可以在不使用VBA的情况下计算Excel 2013中颜色填充的单元格的数量?像
这样的东西COUNTxxx(A1:A20)
答案 0 :(得分:2)
不幸的是,仅使用Excel内置函数无法完成此任务。
有两种方式:
您可以找到有关计算/求和彩色单元格的方法的更多详细信息,包括 VBA代码,在这篇博文中: How to count and sum cells by color in Excel
答案 1 :(得分:1)
非常确定您必须使用VBA
答案 2 :(得分:1)
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
在excel中使用此功能
=CountColor(A1:E25;3)
3 =红色