Hello everyone,
I decided to write from the beginning to the end a solution to the problem with counting colors "for green". Perhaps someone will find it useful in the future.
1. Open an excel sheet
2. Go to File / Save As here, select from the Save as type list: Excel macro-enabled workbook and enter a name for your file. Then save it wherever you want.
3. Go to the Developer tab at the top of the spreadsheet and click on the icon on the left called Visual Basic. In the tree on the left, double-click on Module1 and paste the following content there (if module1 does not exist, right-click in the empty field under the word "this workbook" and insert module1):
Function Kolor(Adres As Range)
Application.Volatile True
Kolor = Adres.Interior.ColorIndex
End Function
Close the displayed windows (save changes) by returning to the spreadsheet.
FINISHED :)
How does it work now?
Example:
enter Jan in cell A1
in cell B1 enter = color (A1) => a numerical value should appear (press F9)
Change the color of A1 to red and press F9. The value should change.
How to count the values of all colored cells now. For example, I recommend the count if functions
eg for the green color the value is 43. In C1 we enter the number if (B: B; 43), that is, if the number 43 appears in column B, the sum of such cells will be by +1.
We color all cells in column A, press F9 and in cell C1 there is the number of such cells. Easy

If you are not satisfied that the color values in column B are shown, I suggest you simply hide this column.
Best regards!
Su