沒有函數,只有宏。
1、電腦打開要獲取單元格顏色的表格。
2、打開表格後,Alt+F11進入宏,點擊插入模塊。
3、點擊插入模塊後輸入代碼
Function SUMColor(rag1 As Range, rag2 As Range)
tile
For Each i In rag2
If rIndex = rIndex Then
SUMColor = SUMColor + 1
End If
Next
End Function。
4、輸入代碼後,返回Excel,在任意單元格中輸入=SUMColor(B2,$A$1:$B$6)。
5、回車就可以得到B2單元格顏色數量了。