background color count

cmccabe

Active Member
Joined
Feb 20, 2008
Messages
396
I am using the following formula and getting a #NAME returned

I just need the count of the red background color cells.

Code:
=SUMPRODUCT(--(ExtCell("backgroundcolor",$E$2:$E$13,1)=3))

where E2:E13 have the values and only the red background (=3) is needed. If the green and yellow background colors where needed what do I set the = to? Thank you.
 

Some videos you may like

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

ZVI

MrExcel MVP
Joined
Apr 9, 2008
Messages
3,802
Office Version
  1. 2016
  2. 2010
  3. 2007
Platform
  1. Windows
ExtCell is UDF (User Defined Function).
For more details see this

For yellow use: =6, for green =10
 
Last edited:

ZVI

MrExcel MVP
Joined
Apr 9, 2008
Messages
3,802
Office Version
  1. 2016
  2. 2010
  3. 2007
Platform
  1. Windows
You can use Conditional Formatting (CF) colors based on the cells values of addition column.
Then just count that aux column values instead of the colors.
For example, values of column D wil be 0 for none color of E cell, 1 for green, 2 for yellow, 3 for red.
Set CF accordingly but count numeric values in aux column D, not the collors:
=COUNTIF(D1:D12,3) returns count of red colors in E
 
Last edited:

Watch MrExcel Video

Forum statistics

Threads
1,122,608
Messages
5,597,143
Members
414,129
Latest member
mr vba

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