TOP

CountByCellColor function

COUNTBYCELLCOLOR() Description

Many people use colors to indicate cells. Working with cell colors can make the data in the workbook easier to understand LO Calc .

Unfortunately, LO Calc has no built-in functionality for using cell colors as conditions in formulas. Building formulas that only count or sum cells of certain colors can get really cumbersome. This often results in complex formulas that are prone to error when making changes.

The COUNTBYCELLCOLOR() function counts the number of cells that have a specific fill color.


Main Features of the COUNTBYCELLCOLOR Function

Syntax:

=COUNTBYCELLCOLOR(RangeToCount; SampleCell)

Parameters:

Example Usage

The COUNTBYCELLCOLOR() function is easy to use. You just need to specify the desired range of cells to count and specify the cell that contains the desired color pattern, and LO Calc will automatically count the number of cells with the same color:

=COUNTBYCELLCOLOR(RangeToCount; SampleCell)

We will have the following result:

COUNTBYCELLCOLOR formula usage

This example uses the following values:

Do you recognize any of these situations?

Calculation notes

Because LO Calc recalculates the formula only when the value in the cell (which it references) changes, not when the colors change, some worksheet formulas do not always trigger to update. In this case, you can use the F9 or Ctrl+Alt+F9 key combination to update the formulas in YLC Utilities.

Download the extension

You can use the function COUNTBYCELLCOLOR() by installing the extension YLC Utilities .

After that, this function will be available in all files that are opened in LibreOffice Calc .