Counting SHADED cells only

makinmomb

Active Member
Joined
Dec 23, 2013
Messages
401
Is there a way to count shaded cells only , I am stranded in a case where I am waiting reply meanwhile I need to self sort myself with another indirect trick
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
No this is not possible.
If you do want to do this, you would need to write your own function. For example:

Code:
Function COUNTSHADED(rng As Range) As Long

Dim lngCount As Long
Dim CellA As Range

For Each CellA In rng
    If CellA.Interior.Color <> 16777215 Then 'Blank interior
        lngCount = lngCount + 1
    End If
Next CellA

COUNTSHADED = lngCount

End Function


You can then use "=COUNTSHADED" function like any other function.

Hope this helps.
Brettster
 
Upvote 0
Is there a way to count shaded cells only , I am stranded in a case where I am waiting reply meanwhile I need to self sort myself with another indirect trick
How did the cells get their shading... manually set or by means of Conditional Formatting?
 
Upvote 0
How did the cells get their shading... manually set or by means of Conditional Formatting?

Manually

Need that because a case of mine is half way sorted, in case you get time it called Q2 Q3 Q3 ( COUNTING REPEAT CLIENTS ) , The below seems to be answer not working

=SUMPRODUCT(IF((ISNUMBER(D$2:D$11)*(COLUMN(D$2:D$11)-3<value(RIGHT(C14,1)))</value(ISNUMBER(E$2:E$11)*(COLUMN(E$2:E$11)-3<value(RIGHT(C14,1)))+(ISNUMBER(F$2:F$11)*(COLUMN(F$2:F$11)-3<value(RIGHT(C14,1)))>0,1,0),ISNUMBER(INDEX($D$2:$G$11,0,VALUE(RIGHT(C14,1))))*(H$2:H$11>100000))

 
Upvote 0

Forum statistics

Threads
1,214,589
Messages
6,120,415
Members
448,960
Latest member
AKSMITH

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