ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How do I count cells with a specific cell shading? (https://www.excelbanter.com/excel-worksheet-functions/118331-how-do-i-count-cells-specific-cell-shading.html)

Mistermond

How do I count cells with a specific cell shading?
 


Bob Phillips

How do I count cells with a specific cell shading?
 
See http://www.xldynamic.com/source/xld.ColourCounter.html for a working
solution

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Mistermond" wrote in message
...




Mistermond

How do I count cells with a specific cell shading?
 
That works a treat! Thanks.
However, I have an additional complication in that I only want to count
cells of a specific colour AND with non-zero values. I'm afraid my VBA isn't
up to it!
Any idea?
Ray Mount

"Bob Phillips" wrote:

See http://www.xldynamic.com/source/xld.ColourCounter.html for a working
solution

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Mistermond" wrote in message
...





Bob Phillips

How do I count cells with a specific cell shading?
 
It is counted by VBA, the VBA returns an array of matching colours, it is
the SP formula. So use something like

=SUMPRODUCT(--(C1:C1000<0),--(ColorIndex(C1:C1000)=Colorindex(A1))

where A1 is coloured with your test colour.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Mistermond" wrote in message
...
That works a treat! Thanks.
However, I have an additional complication in that I only want to count
cells of a specific colour AND with non-zero values. I'm afraid my VBA

isn't
up to it!
Any idea?
Ray Mount

"Bob Phillips" wrote:

See http://www.xldynamic.com/source/xld.ColourCounter.html for a working
solution

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Mistermond" wrote in message
...







Mistermond

How do I count cells with a specific cell shading?
 
Spot one once again!
Thanks very much - it has saved me a lot of effort now and in the future.
Ray Mount


"Bob Phillips" wrote:

It is counted by VBA, the VBA returns an array of matching colours, it is
the SP formula. So use something like

=SUMPRODUCT(--(C1:C1000<0),--(ColorIndex(C1:C1000)=Colorindex(A1))

where A1 is coloured with your test colour.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Mistermond" wrote in message
...
That works a treat! Thanks.
However, I have an additional complication in that I only want to count
cells of a specific colour AND with non-zero values. I'm afraid my VBA

isn't
up to it!
Any idea?
Ray Mount

"Bob Phillips" wrote:

See http://www.xldynamic.com/source/xld.ColourCounter.html for a working
solution

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Mistermond" wrote in message
...









All times are GMT +1. The time now is 08:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com