# Count by colour

#### Ben_UK

##### Board Regular
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.

#### north19701

##### Active Member
Would it not be more simple to just count values that are greater than 750?

#### Ben_UK

##### Board Regular
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,

Kind Regards

Ben

#### Iridium

##### Well-known Member
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

Replies
11
Views
404
Replies
11
Views
732
Replies
1
Views
392
Replies
2
Views
429
Replies
1
Views
4K

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.

### Which adblocker are you using?

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

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