garretthered
New Member
- Joined
- Feb 7, 2017
- Messages
- 8
I need help trying to get a count of cells that have a specific fill color and certain value. It would be like how many pink cells contain the value 3.
Actually, you can, using VBA. As matter as fact, some people have created their own "CountByColor" functions.Short answer is that you cannot count cells based on color.
Actually, you can, using VBA. As matter as fact, some people have created their own "CountByColor" functions.
See:
Excel Counting cells by interior color using VBA
Color Functions In Excel
You should probably clarify that a bit in the future so it is clear that you are not saying it is not possible (because it can easily be interpretted that way).Key word was "short". Sure it's possible but it isn't simple (at least not to me). If the OP wants to create a UDF then more power to them.
Just for reference I am creating a scheduling spreadsheet that uses colored cell for gender and a number value that corresponds to a specific work shift.
[COLOR=#333333]If c.Interior.ColorIndex = "6" And c.Value <> "" And Not IsNumeric(c.Value) Then
[/COLOR]
[COLOR=#333333]If c.Interior.ColorIndex = 6 And c.Value = 3 Then
[/COLOR]