Count the colour cells

Basiliadmonte

New Member
Joined
Mar 30, 2013
Messages
1
I have filled in colour in certain cells of the excel sheet.If now i have to count the number of cells filled What I have to do???? I m trying a number of things but yet unable to do it .......................PLease help

A
1 Y
2 -
3 -
4 Y
5 -
6 -
Now what is the formula to be used for this where the "Y' cells are colored as red?
 
Last edited:

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Color is not data to Excel. The formula will not update automatically if you change the color of a cell.
 
Upvote 0
HI,
insert this code in VBA
Code:
Function CountByColor(InRange As Range, _
WhatColorIndex As Integer, _
Optional OfText As Boolean = False) As Long


Dim Rng As Range
Application.Volatile True


For Each Rng In InRange.Cells
If OfText = True Then
CountByColor = CountByColor - _
(Rng.Font.ColorIndex = WhatColorIndex)
End If
Next Rng


End Function
and the use this formula on your sheet =COUNTBYCOLOR(A1:A15;3;VERO)
(maybe you'll must change VERO with TRUE, i'm not sure, i'm italian and i'm using italian ms office;))
 
Upvote 0

Forum statistics

Threads
1,203,428
Messages
6,055,325
Members
444,781
Latest member
rishivar

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