Counting Colored cells in a database

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like 2 apologize to everyone who have help me on the post of
"Counting Cells" but im confused with everyone agreeing and disagreeing on
using this and that methods...which i don know where to make ammendments in
my code and formulas now....Thanks to u all first....

Could someone pls help me clearly on how should i do it?
My database contains some coloured cells.....with conditional
formatting.....and i would like to have maybe the calculation below
.......which will calculate how many E.g. columns in red
columns in orange
columns in yellow
and etc........

Its urgent and i would be so glad if anyone can help me step by step
and clearly on this? Im not really good in Excel....that's y im trying to
learn..... Thanks to all.....
 
Sorry...i mean thanks to u all *anyway*...i appreciate some of the help...
 
If the column(s) has conditional formatting as in format>conditional
formatting then I think the best way would be to count based on the
conditions of the formatting, what are the conditions for the different
colours? Then use those conditions either in a countif or sumproduct
depending on how complicated the conditions are. Otherwise you can go here
to find CF functions

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

to install a function, if you want it to be connected with this particular
workbook, open the workbook with the colours, press Alt + F11, look in the
project pane to the left to make sure it is the right workbook, do
insert>module and paste the function code in there, press Alt + Q to close
the editor and save the workbook, thee refer to it as

=MyFunction()

If you want it to be available for all workbooks you can paste it into the
personal.xls (the drawback is that you have to refer to it as in

=Personal.xls!MyFunction()

or you can open a new workbook, press Alt + F11 like in the first example,
then save it as MyFunction.xla (*.xla), put it in the xlstart and check it
under tools>add-ins, then you can refer to it as

=MyFunction()

w/o the reference to the personal.xls from any workbook. That is usually
what I do
 
Hi Peo,
pasting the function code to "Insert > Module" meaning? the code from the
URL that u gave me?? copy paste all in there....??

and where would like write this =MyFunction() to?

Sorry.....because im not good in it...
 
I think I'd try to mimic the conditional formatting formula in the formula that
would count the cells. I've found that working with conditional formatting
inside a userdefined function much more difficult than just mimicking those
rules.

For instance, if the orange colored cells are the ones that have "Apples" in the
cell, then:
=countif(a1:c9,"apples")
could be enough. (Yeah, a totally simple example!)
 
What do u mean by mimic the conditional formatting formula in the formula
that would count the cells?? ....on the coloured cells itself...already
contains conditional format....so i cannot insert more on to them.....

So now at the bottom of the columns...i would like them to add up how many
cells are in red colour, yellow colour, blue colour and etc are there in this
column??......

Pls help...thanks
 
What Dave means is why is a cell red or blue etc? Then use the same
criteria.
It's hard to explain any further, did you do the conditional formatting,
then what is the condition the formatting is based on?

--
Regards,

Peo Sjoblom

(No private emails please)
 
It's hard to explain any further, did you do the conditional formatting

No, I did about 2 wks ago!

And a week after that I did the formulas to count the cells based on the cf
criteria (due dates) but this poster insists on using a UDF.

So......

Biff
 
Biff said:
No, I did about 2 wks ago!

And a week after that I did the formulas to count the cells based on the cf
criteria (due dates) but this poster insists on using a UDF.

So......

And the saga continues, Biff <bg>. Think the OP has posted 2 further
responses to you in the earlier thread. It seems the OP has a combination
of both CF and non CF colored cells (inclusive "no fill color" cells) that
s/he needs to work with. I've posted my 2 cents worth over there ..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top