PC Review


Reply
Thread Tools Rate Thread

Counting Cell Background Colours

 
 
Sam Harman
Guest
Posts: n/a
 
      30th Jul 2011
Hi I have a spreadsheet which has some conditional formatting and
therefore some cells are coloured green, orange or yellow.

Is there a way to count these cells and produce a total number.

For example if row one has 20 columns and 6 of them are coloured
(either green, yellow or orange) can I have a new column at 21 to show
the total number of coloured cells = 6?

Any help appreciated

Thanks

Sam
 
Reply With Quote
 
 
 
 
isabelle
Guest
Posts: n/a
 
      30th Jul 2011
hi Sam,

this is possible, by using the condition that was used to do the conditional format

--
isabelle


Le 2011-07-30 10:01, Sam Harman a écrit :
> Hi I have a spreadsheet which has some conditional formatting and
> therefore some cells are coloured green, orange or yellow.
>
> Is there a way to count these cells and produce a total number.
>
> For example if row one has 20 columns and 6 of them are coloured
> (either green, yellow or orange) can I have a new column at 21 to show
> the total number of coloured cells = 6?
>
> Any help appreciated
>
> Thanks
>
> Sam

 
Reply With Quote
 
Gord
Guest
Posts: n/a
 
      30th Jul 2011
Not easily unless you can count by the condition that caused the color
change.

See Chip Pearson's site for information and code to determine CF
conditions and count them.

http://www.cpearson.com/excel/CFColors.htm


Gord Dibben Microsoft Excel MVP

On Sat, 30 Jul 2011 15:01:40 +0100, Sam Harman <(E-Mail Removed)> wrote:

>Hi I have a spreadsheet which has some conditional formatting and
>therefore some cells are coloured green, orange or yellow.
>
>Is there a way to count these cells and produce a total number.
>
>For example if row one has 20 columns and 6 of them are coloured
>(either green, yellow or orange) can I have a new column at 21 to show
>the total number of coloured cells = 6?
>
>Any help appreciated
>
>Thanks
>
>Sam

 
Reply With Quote
 
Clif McIrvin
Guest
Posts: n/a
 
      30th Jul 2011
"Sam Harman" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi I have a spreadsheet which has some conditional formatting and
> therefore some cells are coloured green, orange or yellow.
>
> Is there a way to count these cells and produce a total number.
>
> For example if row one has 20 columns and 6 of them are coloured
> (either green, yellow or orange) can I have a new column at 21 to show
> the total number of coloured cells = 6?
>
> Any help appreciated
>
> Thanks
>
> Sam



Maybe something like

=SUMPRODUCT(--(A2:T2="Pen")+--(A2:T2>=10)+--(A2:T2=5))

in U2?

More generally,

=SUMPRODUCT(--(A2:T2=condition1)+--(A2:T2=condition2)+--(A2:T2=condition3)+...)

More info on Debra Dalgleish's blog -
http://blog.contextures.com/archives...for-underdogs/

I recommend her link to Bob Phillip's write-up.

--
Clif McIrvin

(clare reads his mail with moe, nomail feeds the bit bucket :-)


 
Reply With Quote
 
Sam Harman
Guest
Posts: n/a
 
      31st Jul 2011
On Sat, 30 Jul 2011 10:14:00 -0500, "Clif McIrvin"
<(E-Mail Removed)> wrote:

>"Sam Harman" <(E-Mail Removed)> wrote in message
>news:(E-Mail Removed)...
>> Hi I have a spreadsheet which has some conditional formatting and
>> therefore some cells are coloured green, orange or yellow.
>>
>> Is there a way to count these cells and produce a total number.
>>
>> For example if row one has 20 columns and 6 of them are coloured
>> (either green, yellow or orange) can I have a new column at 21 to show
>> the total number of coloured cells = 6?
>>
>> Any help appreciated
>>
>> Thanks
>>
>> Sam

>
>
>Maybe something like
>
>=SUMPRODUCT(--(A2:T2="Pen")+--(A2:T2>=10)+--(A2:T2=5))
>
>in U2?
>
>More generally,
>
>=SUMPRODUCT(--(A2:T2=condition1)+--(A2:T2=condition2)+--(A2:T2=condition3)+...)
>
>More info on Debra Dalgleish's blog -
>http://blog.contextures.com/archives...for-underdogs/
>
>I recommend her link to Bob Phillip's write-up.


Hi and thanks for all of your replies and advice.

Clare, if I use your sumprodicy suggestion, what do i use as the
condition as I have tried putting in green, yellow etc but I get an
error and no result....

Any help appreciated

Thanks

Sam
 
Reply With Quote
 
Zaidy036
Guest
Posts: n/a
 
      31st Jul 2011
On 7/30/2011 10:01 AM, Sam Harman wrote:
> Hi I have a spreadsheet which has some conditional formatting and
> therefore some cells are coloured green, orange or yellow.
>
> Is there a way to count these cells and produce a total number.
>
> For example if row one has 20 columns and 6 of them are coloured
> (either green, yellow or orange) can I have a new column at 21 to show
> the total number of coloured cells = 6?
>
> Any help appreciated
>
> Thanks
>
> Sam


The free add-in ASAP Utilities has a function to evaluate color index of
a cell's fill

--
Zaidy036
 
Reply With Quote
 
Sam Harman
Guest
Posts: n/a
 
      31st Jul 2011
On Sun, 31 Jul 2011 09:45:25 -0400, Zaidy036 <(E-Mail Removed)>
wrote:

>On 7/30/2011 10:01 AM, Sam Harman wrote:
>> Hi I have a spreadsheet which has some conditional formatting and
>> therefore some cells are coloured green, orange or yellow.
>>
>> Is there a way to count these cells and produce a total number.
>>
>> For example if row one has 20 columns and 6 of them are coloured
>> (either green, yellow or orange) can I have a new column at 21 to show
>> the total number of coloured cells = 6?
>>
>> Any help appreciated
>>
>> Thanks
>>
>> Sam

>
>The free add-in ASAP Utilities has a function to evaluate color index of
>a cell's fill



Thanks Zaidy but could you expand please....i have ASAP installed but
have no idea how to use it to count the number of cells that have a
cell background colour

Thanks

Sam
 
Reply With Quote
 
Zaidy036
Guest
Posts: n/a
 
      31st Jul 2011
On 7/31/2011 12:25 PM, Sam Harman wrote:
> On Sun, 31 Jul 2011 09:45:25 -0400, Zaidy036<(E-Mail Removed)>
> wrote:
>
>> On 7/30/2011 10:01 AM, Sam Harman wrote:
>>> Hi I have a spreadsheet which has some conditional formatting and
>>> therefore some cells are coloured green, orange or yellow.
>>>
>>> Is there a way to count these cells and produce a total number.
>>>
>>> For example if row one has 20 columns and 6 of them are coloured
>>> (either green, yellow or orange) can I have a new column at 21 to show
>>> the total number of coloured cells = 6?
>>>
>>> Any help appreciated
>>>
>>> Thanks
>>>
>>> Sam

>>
>> The free add-in ASAP Utilities has a function to evaluate color index of
>> a cell's fill

>
>
> Thanks Zaidy but could you expand please....i have ASAP installed but
> have no idea how to use it to count the number of cells that have a
> cell background colour
>
> Thanks
>
> Sam

Here is a function I have used , once for each color:
- the cell color index was taken from a "sample" cell I had set up

=ASAPSUMBYCELLCOLOR(AM$4:AM$171,ASAPCELLCOLORINDEX($AO220))

--
Zaidy036
 
Reply With Quote
 
Clif McIrvin
Guest
Posts: n/a
 
      1st Aug 2011
"Sam Harman" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On Sat, 30 Jul 2011 10:14:00 -0500, "Clif McIrvin"
> <(E-Mail Removed)> wrote:
>
>>"Sam Harman" <(E-Mail Removed)> wrote in message
>>news:(E-Mail Removed)...
>>> Hi I have a spreadsheet which has some conditional formatting and
>>> therefore some cells are coloured green, orange or yellow.
>>>
>>> Is there a way to count these cells and produce a total number.
>>>
>>> For example if row one has 20 columns and 6 of them are coloured
>>> (either green, yellow or orange) can I have a new column at 21 to
>>> show
>>> the total number of coloured cells = 6?
>>>
>>> Any help appreciated
>>>
>>> Thanks
>>>
>>> Sam

>>
>>
>>Maybe something like
>>
>>=SUMPRODUCT(--(A2:T2="Pen")+--(A2:T2>=10)+--(A2:T2=5))
>>
>>in U2?
>>
>>More generally,
>>
>>=SUMPRODUCT(--(A2:T2=condition1)+--(A2:T2=condition2)+--(A2:T2=condition3)+...)
>>
>>More info on Debra Dalgleish's blog -
>>http://blog.contextures.com/archives...for-underdogs/
>>
>>I recommend her link to Bob Phillip's write-up.

>
> Hi and thanks for all of your replies and advice.
>
> Clare, if I use your sumprodicy suggestion, what do i use as the
> condition as I have tried putting in green, yellow etc but I get an
> error and no result....
>
> Any help appreciated
>
> Thanks
>
> Sam



To answer your question, each SUMPRODUCT condition needs to be identical
to the conditional format condition that determines each distinct
background color.

Since you have the ASAP utilities, I think it would be far easier to use
Zaidy's suggestion.

--
Clif McIrvin

(clare reads his mail with moe, nomail feeds the bit bucket :-)


 
Reply With Quote
 
Gord
Guest
Posts: n/a
 
      1st Aug 2011
Cliff

I haven't had ASAP installed for a long time, but the feature Zaidy is
speaking of only returned color indexes of manually backgrounded
cells.

i.e. no good for CF colored cells.

Perhaps Zaidy could confirm yea or nay about newer version or ASAP


Gord Dibben Microsoft Excel MVP

On Mon, 1 Aug 2011 16:53:07 -0500, "Clif McIrvin"
<(E-Mail Removed)> wrote:

>Since you have the ASAP utilities, I think it would be far easier to use
>Zaidy's suggestion.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting cell colours =?Utf-8?B?amMxMzI1Njg=?= Microsoft Excel Worksheet Functions 4 13th Nov 2007 05:22 AM
Excel cell background colours missing =?Utf-8?B?U3VlRzMwMDE=?= Microsoft Outlook Discussion 0 1st Mar 2006 02:39 PM
Excel 2003 font colours and cell colours =?Utf-8?B?YnJldHRh?= Microsoft Excel Misc 1 17th Apr 2005 03:45 AM
Is it possible to automatically change cell background colours? Mike Microsoft Excel Worksheet Functions 2 3rd Dec 2003 12:57 PM
Changing cell background colours Tim Adams Microsoft Excel Worksheet Functions 2 6th Oct 2003 07:06 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:06 PM.