ctrl+F查找,选项,格式,填充(选绿色),查找全部,在查找结果里,选中第一个,拉滚动条到最后,按着shift点击最后一个,关闭查找对话框,在公式编辑栏输入1,按Ctrl+enter填充,在后边用公式=SUM(B1:H1)/COLUMNS(B1:H1)即可得到绿色的占比,想要百分比形式,单元格格式设置为百分比就OK了!
附件是我做的动画,范围跟你的不太相同,不过道理是一样的。
如果不喜欢就VBA自定义函数了,统计某种颜色个数
Function Count背景色(colAs Range, countrange As Range) As Integer
Dim icell As Range
Application.Volatile
For Each icell In countrange
If icell.Interior.ColorIndex = col.Interior.ColorIndex Then
Count背景色= Count背景色+ 1
End If
Next icell
End Function
代码不会用就百度下吧。
I2公式=COUNT背景色(A$6,B2:H2)/COLUMNS(B1:H1)