Excel for Mac (v16.40) - Conditional Formatting Formula

TAPS_MikeDion

Well-known Member
Joined
Aug 14, 2009
Messages
630
Office Version
  1. 2011
Platform
  1. MacOS
Hi all,
I am assuming someone will see this and the formula will be a piece of cake, but I can't wrap my head around it. LOL

All I'm looking to do is to have a conditional formatting formula that checks column P for an x, and COUNTIF (or whatever would work best) columns W to AH (months of the year) if there is an x in each column.

1. If there is an x in column P, then the minimum number of x's from W to AH must be 7 in order for the conditional format BG color to change.
2. If there is no x in column P, then the minimum number of x's from W to AH must be 5 in order for the conditional format BG color to change.

Thank you to anyone offering to help on this!
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
2 Rules
=AND($P2="X",COUNTIF($W2:$AH2,"X")>=7)
and
=AND($P2<>"X",COUNTIF($W2:$AH2,"X")>=5)

for 2007, 2010 , 2013 , 2016 , 2019 or 365 Subscription excel version
Conditional Formatting

Highlight applicable range >>
P2:AH1000 - Change, reduce or extend the rows to meet your data range of rows

>Conditional Formatting
Manage Rules
+
Style = classic
use a formula
=AND($P2="X",COUNTIF($WS2:$AH2,"X")>=7)

Format [Number, Font, Border, Fill] - Whatever colour needed
choose the format you would like to apply when the condition is true
OK >> OK

Repeat for 2nd RULE

Book1
PQRSTUVWXYZAAABAC
1
2
3
4xxxxxxxx
5xxxxx
6
7
8x
9
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
P2:AC8Expression=AND($P2<>"X",COUNTIF($W2:$AH2,"X")>=5)textNO
P2:AC8Expression=AND($P2="X",COUNTIF($W2:$AH2,"X")>=7)textYES
 
Last edited:
Upvote 0
Thanks for the quick response etaf. I will see how that works.

It can't be done as one rule? That's what has been stumping me.
 
Upvote 0
Yes , if you only want 1 colour

OR( AND($P2="X",COUNTIF($W2:$AH2,"X")>=7), AND($P2<>"X",COUNTIF($W2:$AH2,"X")>=5) )

I updated the 1st answer with an XL2BB example
 
Upvote 0
Book1
PQRSTUVWXYZAAABACADAEAFAGAH
1
2xxxxx
3xx
4xxxxxxxx
5xxxxx
6xxx
7xxxxx
8xx
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
P2:AH8Expression=OR( AND($P2="X",COUNTIF($W2:$AH2,"X")>=7), AND($P2<>"X",COUNTIF($W2:$AH2,"X")>=5) )textYES
 
Upvote 0
Solution
Thank you very much etaf, this worked exactly how I needed it to work. I greatly appreciate your assistance on this!
 
Upvote 0

Forum statistics

Threads
1,225,213
Messages
6,183,619
Members
453,176
Latest member
alphonsa12

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