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

%3CLINGO-SUB%20id%3D%22lingo-sub-2318287%22%20slang%3D%22en-US%22%3Eis%20there%20a%20way%20to%20count%20cells%20of%20certain%20color%20in%20spreadsheet%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2318287%22%20slang%3D%22en-US%22%3E%3CP%3EIs%20there%20a%20way%20to%20count%20cells%20of%20certain%20color%20in%20spreadsheet%3F%3C%2FP%3E%3CP%3Eie.%26nbsp%3B%20Want%20to%20count%20the%20cells%20that%20are%20green%2C%20so%20thought%20the%20following%20syntax%20would%20work...%3Dcountif%20(range%2C%20Cell(%22color%22%20%3D%20green)%2C%20but%20it%20only%20returns%20a%20number%20of%20zero%20when%20I%20have%20several%20green%20cells.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2318287%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2318402%22%20slang%3D%22en-US%22%3ERe%3A%20is%20there%20a%20way%20to%20count%20cells%20of%20certain%20color%20in%20spreadsheet%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2318402%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1043860%22%20target%3D%22_blank%22%3E%40jobrown%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECOUNTIF%20only%20counts%20cells%20with%20a%20specific%20%3CEM%3Evalue%3C%2FEM%3E.%3C%2FP%3E%0A%3CP%3ESee%20%3CA%20href%3D%22http%3A%2F%2Fwww.cpearson.com%2Fexcel%2Fcolors.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EColor%20Functions%20In%20Excel%3C%2FA%3E%20for%20some%20custom%20VBA%20functions.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

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.