TOP

CountByCellColor function for LibreOffice Calc

COUNTBYCELLCOLOR() Description

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

Unfortunately, LO Calc has no built-in functions 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 Functions COUNTBYCELLCOLOR

Syntax:

=COUNTBYCELLCOLOR(Range; 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 LibreOffice Calc will automatically count the number of cells with the same color:

=COUNTBYCELLCOLOR(B4:H4; B10)

We will have the following result:

COUNTBYCELLCOLOR formula usage

This example uses the following values:

Do you recognize any of these situations?

Notes on the calculation

Because LO Calc only recalculates the formula when the value in the (referenced) cell changes, not when the colors change, some worksheet formulas don't always trigger to update. In this case, you can use F9 or Ctrl+Alt+F9 to update the formulas in YLC Utilities.

Download the extension

You can use the COUNTBYCELLCOLOR() function by installing a free extension YouLibreCalc.oxt or its full-featured version YLC_Utilities.oxt .

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