Can a formula read styles

Is there a way for a formula to read a style? What I want is to sort of just count how many red cells and how many green cells. Most to the help describes how to make them red or green based on the cell contents. I want to do the opposite and add them up in another column.

Here you go: