Count coloured cells based on conditional formatting

Copper Contributor
Can someone help me please? I am trying to get my spreadsheet to count cells based on their colour after they have been conditionally formatted. I have read various threads on here and made some progress thanks to @Jamil Mohammad I have put a VDA in as per advice elsewhere. However, it is clear that I am making mistakes somewhere. I have attached my file. The formula is put in next to the red cell on the analysis tab. Any help greatly appreciated.
2 Replies

@oconnells 

Your workbook is not macro-enabled and you didn't add the function to your VBA environment.

However, you may use your rules logic in formulas to count the cells, like

=SUMPRODUCT(--($H$4:$H$182<$G$4:$G$182))

 

@oconnells 

 

Hi,

 

your file did not have the UDF, as also pointed by Sergei.

 

In attached file, I placed the UDF and now it counts.