Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default Is it possible to combine countif and countcolor?

I have a range of cells and I need to count how many
have a blue background and a cell value of "C" and how
many have a green background and a cell value of "C"

I can count all the cells in the range that are blue or
green and I can count all the cells that contain the
value of "C", but how can I count the combined
criteria?

I'm thinking I just need some algebraic help... :-S

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 563
Default Is it possible to combine countif and countcolor?

Suppose you are counting the "C" values with
If thisCell.value = "C" then
Kount = Kount +1
End If
.....

and you count Green cells with

If thisCell.Font.ColorIndex = CI 'where CI is the index value
for your shade of green
Kount = Fount +1

The do one of these:

A) Double IF
If thisCell.value = "C" then
If thisCell.Font.ColorIndex = CI
Kount = Kount +1
End if
End if

B) Boolean
If thisCell.value = "C" And thisCell.Font.ColorIndex = CI
Kount = Kount +1
End if


best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme


"Opal" wrote in message
...
I have a range of cells and I need to count how many
have a blue background and a cell value of "C" and how
many have a green background and a cell value of "C"

I can count all the cells in the range that are blue or
green and I can count all the cells that contain the
value of "C", but how can I count the combined
criteria?

I'm thinking I just need some algebraic help... :-S

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 834
Default Is it possible to combine countif and countcolor?

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

HTH

Bob

"Opal" wrote in message
...
I have a range of cells and I need to count how many
have a blue background and a cell value of "C" and how
many have a green background and a cell value of "C"

I can count all the cells in the range that are blue or
green and I can count all the cells that contain the
value of "C", but how can I count the combined
criteria?

I'm thinking I just need some algebraic help... :-S



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default Is it possible to combine countif and countcolor?

Ah...

So:

=SUMPRODUCT((--(colorindex(B6:B34)=35))*(B6:B34="C"))


thank you!!
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 563
Default Is it possible to combine countif and countcolor?

You did not tell us that someone has given you a UDF called 'colorindex' -
it is not part of native Excel
best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme

"Opal" wrote in message
...
Ah...

So:

=SUMPRODUCT((--(colorindex(B6:B34)=35))*(B6:B34="C"))


thank you!!




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 834
Default Is it possible to combine countif and countcolor?

I think he is using the ColorIndex UDF at the link I supplied.


---
HTH

Bob Phillips

"Bernard Liengme" wrote in message
...
You did not tell us that someone has given you a UDF called 'colorindex' -
it is not part of native Excel
best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme

"Opal" wrote in message
...
Ah...

So:

=SUMPRODUCT((--(colorindex(B6:B34)=35))*(B6:B34="C"))


thank you!!




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to combine an AND and a COUNTIF Michael T Charts and Charting in Excel 4 February 1st 09 12:29 PM
Sum + countcolor Opal Excel Programming 2 October 6th 08 09:36 PM
Can I combine CountIf with IF or AND? Gmolatore Excel Discussion (Misc queries) 5 April 24th 08 03:55 AM
countcolor Pascal Excel Worksheet Functions 1 August 22nd 06 02:34 PM
Do I need to combine hlookup and countif????? sharkh Excel Worksheet Functions 2 August 17th 06 05:05 PM


All times are GMT +1. The time now is 02:51 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"