Many people use colors to mark cells. Working with cell colors can facilitate understanding data in the book Excel (Calc).
Unfortunately, Excel (Calc) does not have built-in functions for using cell colors as conditions in formulas. Building formulas that only count or sum cells of certain colors can become really cumbersome. This often leads to complex formulas that are prone to errors when changes are made.
The COUNTBYFONTCOLOR() function counts the number of cells that have a certain font color.
=COUNTBYFONTCOLOR(RangeToCount; SampleCell)
The COUNTBYFONTCOLOR() function is easy to use. You just need to select the desired range of cells and specify the cell that contains the required color, and Excel (Calc) will automatically count the number of cells with the same text color:
=COUNTBYFONTCOLOR(RangeToCount; SampleCell)
We will have the following result:
This example uses the following values:
Since Excel (Calc) recalculates the formula only if the value in the cell (to which it refers) changes, and not when colors change, some sheet formulas do not always run to update. In this case, you can use the F9 or Ctrl+Alt+F9 key combination to update formulas in YLC Utilities.
You can use the function COUNTBYFONTCOLOR() by installing the extension YLC Utilities.
After that, this function will be available in all files that will be opened in Excel (LibreOffice Calc).