Using Conditional Formatting and ColorFunction?

SDJ98

New Member
Joined
Apr 21, 2011
Messages
27
Hi All,

I have a spreadsheet with a bunch of different metrics (in the columns). My conditional formatting is set to shade the cell if they meet a certain threshold, but some are things like letter grades and others are numbers. My plan was to then count the number of shaded cells at the end. I've got the colorfunction working, however it will not work with conditional formatting. My understanding is that conditional formatting doesn't change the actual cell color.

Is there any way to modify the two or perhaps add in another function. My only other option is to sum about 25 columns x 150 rows manually (looking at the shaded cells and just counting in my head), so any help is GREATLY appreciated.

Thanks.
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
How would I go about setting any of those formulas to COUNT the number of cells that are conditionally formatted to return a certain shading?
 
Upvote 0
I set my formula to

=countofcf(B8:AO8,1)

where B8:A08 is my range of data I want to count the number of shaded cells in. The current formula returns 9, which is neither the number of shaded cells, nor the number of cells that are set to have a conditional formatting (whether its currently 'triggered' or not).

Any thoughts?
 
Upvote 0
last ditch bump before I start counting these cells by hand...thanks

I made sure every conditional format referrences an actual cell, not a formula.
 
Upvote 0
still hoping to get some resolution on this. if I use the formula =activecondition(A1)

it should tell me if the cell is returning a conditional formot of 1, 2, 3 or 0, with zero meaning no condition applies correct? I ask because on some of the cells where there is conditional formatting it returns zero, but on others where it doesn't have formatting, it returns 1.

I just pasted the code from Chip Pearson into a module, FWIW
 
Upvote 0
And Chip says:
NOTE: ActiveCondition may result in an inaccurate result if the following are true:

You are calling ActiveCondtion from a worksheet cell, AND
The cell passed to ActiveCondtion uses a "Formula Is" rather than
"Cell Value Is" condition, AND
The formula used in the condition formula contains relative addresses
... is that the case?
 
Upvote 0
And Chip says:... is that the case?


It's possible, but only if I'm not understanding what he's trying to say.


My spreadsheet is set up like


................Metric 1 .......Metric 2 .........Metric 3
Office 1 .........A+ .............80% ..........10,000
Office 2 .........B- ..............16% ...........7,500
Office 3 ..........C ...............70% ..........8,800

where each metric is a different kind of information. They're all pulling from getpivotdata functions or vlookups. Each cell is set to a conditional format. The conditional formats all follow the same pattern of "Cell Value is", then some version of "greater than" then "=$A$1" where the cell value is just a percent, number, etc that I set based on what I want to highlight.

None of the conditional formats reference formulas, so I'm not sure what the problem is.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,541
Messages
6,179,418
Members
452,912
Latest member
alicemil

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top