Sunday, March 06, 2016

Count the Colors

I bid 3 Red

What if you would like to know the color name or to count or to sum cells by a fill color? There is no built-in function in Excel.

In this case you can make a User Defined Function (UDF).

Here is the sample UDF that you can use to analyze, count and sum the cells depending on their filled color.

These UDF function can be used in the same way as built-in functions that you can use in the worksheet.

  • AnalyzeColor Returns the color name, the color index or color index in RGB.
    Syntax: AnalyzeColor(color range, optional; "text" or "index" or "rgb". When it is omitted "text" is used.)


  • CountColor Counts the number of cells depending on their filled color.
    Syntax: CountColor(color range, target range)


  • SumColor Adds all the numbers in a range of cells depending on their filled color.
    Syntax: SumColor(color range, target range)
Sum and Count by fill color

Chip Pearson:
Working with Cell Colors



See all Topics

No comments: