Could you please try below method. This will give you count of cells which has Yellow background.
You can modify the formula as per your need.
Go to Formula manager.
Formulas --> Name Manager --> New
Paste this formula =GET.CELL(63,!A1)
I have named it as "GetCellColor".
Assuming your data is column A. Type this formula in B.
=GetCellColor
The formula will return numbers based on the cell color.
6 is for Yellow. Then take a countif of 6.
Please note that the function GET.CELL(63,...) does not consider CF cells.
Secondly , when ever there is a change in the colour of any cell , the user will have to press ALT CTRL F9 to ensure that the change is taken into account.