is there a way to count cells of certain color in spreadsheet?

Copper Contributor

Is there a way to count cells of certain color in spreadsheet?

ie.  Want to count the cells that are green, so thought the following syntax would work...=countif (range, Cell("color" = green), but it only returns a number of zero when I have several green cells.

1 Reply

@jobrown 

COUNTIF only counts cells with a specific value.

See Color Functions In Excel for some custom VBA functions.