Counting cells based on color

I have a calendar built, and I would like to be able to fill cells with a color and have a way to count the number of cells that have that color.

So, in a defined range filled with, for example, red (representing vacation days) how can I sum all cells filled with red.

This is helpful as I can slowly fill in all vacation days, holidays, then half or quarter vacation days, and quickly move them around and see where my total remains after different iterations.

Thanks for your time.

Hi @ben_says, no function implemented to do it.
And I think it is not always a good approach to do it, i.e. a little difference in the colour do not get the cell. I think much better, clear and easy to mantaing, using another column to set what you want, and with conditional formatting set up the cell colour.

But you can find a solution on this thread in Aoo forum, where several introspective functions are developed in star basic (macros), and one of them gives the background colour.
Calc, Basic: Introspective cell functions