count colored cells

Sharksfan

New Member
Joined
Nov 3, 2017
Messages
22
we have a spreadsheet with six columns. The cells in the six columns have conditional formatting and change color based on the value in them. Colors are red, green, and yellow. I want to count the number green and yellow cells in a row. Can this be done? Below is an example, except the cells would be colored (not words) based on conditional formatting. I have tried creating a colorcount function, but because of conditional formatting it only sees them as normal white cells.


Months SoldL6TTLL6 SDCLOC %L6SDC CUSTAVG cost

count of Green and Yellow
RedRedGreenGreenYellowGreen4
GreenGreenGreenGreenRedYellow5

<tbody>
</tbody>
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
You can use function COUNTIFS by mirroring all the conditions that trigger the CndFrmt. In other words, if AVG Cost is CndFrmt green because it meets a certain condition and LOC% is yellow because it meets some other condition, etc, use COUNTIFS with your six fields in your data as each of the arguments in COUNTIFS.
 
Upvote 0
If the values that trigger the background color are simply one number for yellow (e.g., 6) and one number for green (e.g., 4), then G2 (fill down) could be:

Code:
=COUNTIF(A2:F2,4)+COUNTIF(A2:F2,6)

For example, if Green's number could be either a 4 or 5, then this should count:

Code:
=COUNTIF(A2:F2,4)+COUNTIF(A2:F2,5)+COUNTIF(A2:F2,6)
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,751
Members
448,989
Latest member
mariah3

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