Counting Coloured Cells

mpantalo

New Member
Joined
Nov 3, 2005
Messages
27
Hi,

I have a spreadsheet that has cells coloured either grey or white. Is there a formula I can use to count the number of white (or grey) cells?

Regards
mpantalo
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

Fazza

MrExcel MVP
Joined
May 17, 2006
Messages
9,368
Hi,

I'm assuming you want a non-VBA solution. If you want a VBA solution then please search the archives or some websites - maybe Chip Pearson's or John Walkenbach's or Debra Dagliesh's?

A special formula can be used in a helper column to return the code number for the colour and then you can use a standard COUNTIF on this helper column. Here is an old post that discusses the method http://www.mrexcel.com/board2/viewtopic.php?t=213224

Some explanation, this functionality is not routine but is available via an old Excel4 macro function that can be used in a formula in a defined name. It can not be used directly in a worksheet formula. Create the defined name formula remembering to set up the formula for relative referencing (the active cell when you create the formula relative to the cell that you want to test). It doesn't work on colours created from conditionally formatting and doesn't update automatically with changes to cell colours. If this approach is not OK for you, you'll need some VBA.

Cheers, Fazza
 
Upvote 0

Scott Huish

MrExcel MVP
Joined
Mar 17, 2004
Messages
19,961
Office Version
  1. 365
Platform
  1. Windows
Are the cells colored by conditional formatting or not?

If by conditional formatting, what is the condition to format the cells? And in what range?
 
Upvote 0

Forum statistics

Threads
1,191,092
Messages
5,984,600
Members
439,896
Latest member
SquareCare

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