VBA Counting Conditional Formatted Cells

Raggedyman

New Member
Joined
Jan 9, 2020
Messages
20
Office Version
  1. 2016
Platform
  1. MacOS
I'm looking to figure the code to count conditional formatted cells.
D2:O2 totals has the following formula =IF(COUNTIF(D3:D8,MIN(D3:D8))=1,MIN(D3:D8)," ")
Each cell in the range of D2:O5 are conditionally formatted so if there is a low number, the cell highlights "Yellow"
What I'm have trouble with is column Q2:Q6, these cells should total the highlighted cell(s) but I'm at a loss.
Q2:Q6 should total the number of highlighted cells from each row.
Thank you in advance.

Book1
ABDEFGHIJKLMNOPQ
1MonthJanFebMarAprMayJunJulAugSepOctNovDecTotMarks
21Jim510152025293539455055603880
32Jane51115192530344045505560389
43Nancy51015202529354045505559388
54Joe51115182528354045505560387
65April41014192530354045505560387
84 1418 283439 597
Marks
Cell Formulas
RangeFormula
Q2Q2=SUMIF(D2:O2,S2,D2:O2)
P2:P6P2=SUM(D2:O2)
D8:L8D8=IF(COUNTIF(D2:D7,MIN(D2:D7))=1,MIN(D2:D7)," ")
M8:O8M8=IF(COUNTIF(M2:M6,MIN(M2:M6))=1,MIN(M2:M6)," ")
Q8Q8=COUNT(D8:O8)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C2:O6Cell Value=C$8textNO
B3Cellcontains a blank value textNO
B2Cellcontains a blank value textNO
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
=SUMPRODUCT((D2:O2=D$8:O$8)*(D2:O2=D$8:O$8))
 
Upvote 0
.. or even
=SUMPRODUCT(--(D2:O2=D$8:O$8))
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,693
Members
448,979
Latest member
DET4492

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