Count by colour

Ben_UK

Board Regular
Joined
Feb 19, 2003
Messages
206
Hiya Board,

Column C on my sheet contains a 3 digit number between 101 - 999,
Those cells are conditional formatted so that any entry over 750 turns the font Red,

Is it possible to automatically count how many entries in col C are red

Any help would be greatly appreciated,

Kind Regards

Ben
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Ben_UK

Board Regular
Joined
Feb 19, 2003
Messages
206
Sorry,

I was just using that as an example (to keep the question simple)

Forget the numbers...
Basically I am looking for operator input errors in column C,
So I am purely looking to count cells that contain red font,

Apologies for the misleading question :oops:

Kind Regards

Ben
 
Upvote 0

Iridium

Well-known Member
Joined
Jul 15, 2002
Messages
2,831
An alternate solution to the one north19701 provided at Chip Pearsons site

Rich (BB code):
Function CountColor(rColor As Range, rSumRange As Range)

''''''''''''''''''''''''''''''''''''''
' Written by Ozgrid Business Applications
' www.ozgrid.com
' http://www.ozgrid.com/VBA/Sum.htm
' Counts cells based on a specified fill color.
'''''''''''''''''''''''''''''''''''''''
Dim rCell As Range
Dim iCol As Integer
Dim vResult

iCol = rColor.Interior.ColorIndex

   For Each rCell In rSumRange
    If rCell.Interior.ColorIndex = iCol Then
         vResult = vResult + 1
    End If
   Next rCell

CountColor = vResult
End Function

HTH
 
Upvote 0

Forum statistics

Threads
1,186,371
Messages
5,957,469
Members
438,307
Latest member
bigmike1720

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
Top