Each cell contains some text and a background color. So I have some cells that are blue and some that are red. What function do I use to count the number of red cells?
The worksheet formula, =CELL("color",D3) returns 1 if the cell is formatted with color for negative values (else returns 0).
You can solve this with a bit of VBA. Insert this into a VBA code module:
Function CellColor(xlRange As Excel.Range)
CellColor = xlRange.Cells(1, 1).Interior.ColorIndex
End Function
Then use the function =CellColor(D3) to display the .ColorIndex of D3