conditional formatting - formula function - countif

j4ymf

Well-known Member
Joined
Apr 28, 2003
Messages
735
Office Version
  1. 365
Platform
  1. Windows
Hello All

I'm using the formula function in conditional formatting, How do I make this formula work

This one is fine

Code:
=(COUNTIF(F14:F34, "H")>=5)

I'm trying something like this but can't get it to work, i'm getting to many arguments
I would like to add additional cells

my plan is to turn all the cells black if greater that 5 = to H


Code:
=(COUNTIF(F14:F34,F9,F10,F12 "H")>=5)

many thanks jason
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Jason,

With the three ranges in F selected try the following custom formula...

=COUNTIF($F$14:$F$34,"H")+COUNTIF($F$9:$F$10,"H")+($F$12="H")>=5

Hope that helps.
 
Upvote 0
As an alternative, try this:

=SUM(COUNTIF(INDIRECT({"F14:F34","F9","F10","F12"}),"H"))>=5
 
Upvote 0
@Snakehips:

Thank you for pointing this out -- I missed the CF part. It does not work for CF.
 
Upvote 0
This formula does work for CF:

=SUM(--(F14:F34="H"),--(F9:F10="H"),--(F12="H"))>=5


Surely the range refs need to be absolute....

=SUM(--($F$14:$F$34="H"),--($F$9:$F$10="H"),--($F$12="H"))>=5

Edit : or at least the row refs.
 
Last edited:
Upvote 0
The OP did not have absolute rows/columns -- perhaps this is a single-cell CF.

Point taken. OP's 'plan is to turn all cells black' when H count 5 or more lead me to believe that the cf would be applied to the whole of the test range, hence my comment. All will become clear in due course.��
Like the SUM construct. I rate your your posts.
 
Upvote 0
Thank you for your help

Snakehips

this works great
Code:
=SUM(--($F$14:$F$34="H"),--($F$9:$F$10="H"),--($F$12="H"))>=5

ill get that bit complete then I be back
thanks for your help
 
Upvote 0

Forum statistics

Threads
1,203,356
Messages
6,054,935
Members
444,759
Latest member
TeckTeck

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