View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max
 
Posts: n/a
Default How to sum data based on font or cell color?

.. My problem is that even though the
conventional formatting is working for the cells in the row, when you
click on each individual cell, the shading shows no color (even though
you are looking at it and it is GREEN). Because of this, the UDF is not
calculating right.


The above sounds like the cells are conditionally formatted, which Bob's UDF
doesn't cover, re his "Contraints" section in the page:
"... The second shortcoming is that this technique at present does not cater
for cells that are coloured due to conditional formatting."

For CF cases, one way is to try using the same conditions as applied for the
CF
Eg if col B is conditionally formatted with the formula: =A110,
then we could use something like this in say, C1: =SUMIF(A:A,"10",B:B)
to sum col B if col A 10
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"jzzman" wrote:


Thanks for the posting. Funny, I am working on the same thing. I have a
small problem with this. I am using conventional formatting to change
the color of a row based on the contents of a cell. Status column
"completed" = change row shade to green. Now, I am using the UDF below
to sum the green shaded rows. My problem is that even though the
conventional formatting is working for the cells in the row, when you
click on each individual cell, the shading shows no color (even though
you are looking at it and it is GREEN). Because of this, the UDF is not
calculating right. Any thoughts here? I greatly appreciate it.

Jzzman