How do I count conditional formatted cells based on it's colors.

Goldenrules

New Member
Joined
Jul 16, 2022
Messages
24
Office Version
  1. 365
  2. 2021
  3. 2019
Platform
  1. Windows
  2. Mobile
  3. Web
Good day everyone and professionals in the house

Please I really need your help with this, I have been trying to count conditional formatted cells based on it's colors, but when I didn't find the appropriate code I had to start filling it up manually.

So there are 3 major colors there Green, Red and Blue
Note (the yellow color done not count)

And anyway there is no leading color it will be referred to no winning color eg 2-2-1, 2-2-2, 3-3-0, 3-0-3.

Thanks in advance.
 

Attachments

  • Screenshot_20221209-073922_1670569795848_1670570126907.jpg
    Screenshot_20221209-073922_1670569795848_1670570126907.jpg
    128.3 KB · Views: 8
  • Screenshot_20221209-074730_1670569714213_1670570050393.jpg
    Screenshot_20221209-074730_1670569714213_1670570050393.jpg
    217.6 KB · Views: 10
  • Screenshot_20221209-074702_1670569838124_1670569993970.jpg
    Screenshot_20221209-074702_1670569838124_1670569993970.jpg
    189.3 KB · Views: 8
  • Screenshot_20221209-074119_1670569813508_1670569935417.jpg
    Screenshot_20221209-074119_1670569813508_1670569935417.jpg
    159.9 KB · Views: 9

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Try.
My way is without VBA, but somehow complicated.
I will explain how do I get the way.
Hope this help.

Step1. To have 7 helper columns as my following XL2BB.
Step2. Put my formulas in column "I", "K:M", and "V" .
Step3. Make conditional formats in column "I".

Step1~3 just show how.
To instead, you also can copy my XL2BB into a new workbook, and add the conditional formats in column "I".

Step4. Select cell "O2" EXCATLY, and then press "Ctrl+F3" to add a new NAME "color" PRECISELY refers to "=GET.CELL(63,A2)".
Step5. Put the formula "=color" in the cell "O2".
Step6. copy the cell "O2" to cells "O2:T16".

Step4~6 should be done carefully.
If you copy from my XL2BB directly, you should just do the Step4, no more Step5~6.

And then we still have one problem.
In my example, my "RED" refers to color 3.
My "GREEN" refers to color 50.
And my "BLUE" refers to color 33.
I think we should have different RED, GREEN, or Blue very likely.

Here is my excel file to download for your reference.
color.xlsm (11.75KB) - SendSpace.com

Good luck.

Cell Formulas
RangeFormula
K2:K16K2=COUNTIF($O2:$T2,3)
L2:L16L2=COUNTIF($O2:$T2,50)
M2:M16M2=COUNTIF($O2:$T2,33)
O2:T16O2=color
I2:I16I2=IF(V2="","NONE","")
V2:V16V2=IF(AND(K2>L2,K2>M2),"RED","")& IF(AND(L2>K2,L2>M2),"GREEN","")& IF(AND(M2>K2,M2>L2),"BLUE","")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
I2:I16Expression=I2="NONE"textNO
I2:I16Expression=V2="BLUE"textNO
I2:I16Expression=V2="GREEN"textNO
I2:I16Expression=V2="RED"textNO
 
Upvote 0
Solution
Try.
My way is without VBA, but somehow complicated.
I will explain how do I get the way.
Hope this help.

Step1. To have 7 helper columns as my following XL2BB.
Step2. Put my formulas in column "I", "K:M", and "V" .
Step3. Make conditional formats in column "I".

Step1~3 just show how.
To instead, you also can copy my XL2BB into a new workbook, and add the conditional formats in column "I".

Step4. Select cell "O2" EXCATLY, and then press "Ctrl+F3" to add a new NAME "color" PRECISELY refers to "=GET.CELL(63,A2)".
Step5. Put the formula "=color" in the cell "O2".
Step6. copy the cell "O2" to cells "O2:T16".

Step4~6 should be done carefully.
If you copy from my XL2BB directly, you should just do the Step4, no more Step5~6.

And then we still have one problem.
In my example, my "RED" refers to color 3.
My "GREEN" refers to color 50.
And my "BLUE" refers to color 33.
I think we should have different RED, GREEN, or Blue very likely.

Here is my excel file to download for your reference.
color.xlsm (11.75KB) - SendSpace.com

Good luck.

Cell Formulas
RangeFormula
K2:K16K2=COUNTIF($O2:$T2,3)
L2:L16L2=COUNTIF($O2:$T2,50)
M2:M16M2=COUNTIF($O2:$T2,33)
O2:T16O2=color
I2:I16I2=IF(V2="","NONE","")
V2:V16V2=IF(AND(K2>L2,K2>M2),"RED","")& IF(AND(L2>K2,L2>M2),"GREEN","")& IF(AND(M2>K2,M2>L2),"BLUE","")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
I2:I16Expression=I2="NONE"textNO
I2:I16Expression=V2="BLUE"textNO
I2:I16Expression=V2="GREEN"textNO
I2:I16Expression=V2="RED"textNO
You are so amazing sir, thanks so much for your prompt response. Thanks exactly what am longing to do, you are ready a blessing to this age.

Really appreciate.

I will get to it now
 
Upvote 0
Try.
My way is without VBA, but somehow complicated.
I will explain how do I get the way.
Hope this help.

Step1. To have 7 helper columns as my following XL2BB.
Step2. Put my formulas in column "I", "K:M", and "V" .
Step3. Make conditional formats in column "I".

Step1~3 just show how.
To instead, you also can copy my XL2BB into a new workbook, and add the conditional formats in column "I".

Step4. Select cell "O2" EXCATLY, and then press "Ctrl+F3" to add a new NAME "color" PRECISELY refers to "=GET.CELL(63,A2)".
Step5. Put the formula "=color" in the cell "O2".
Step6. copy the cell "O2" to cells "O2:T16".

Step4~6 should be done carefully.
If you copy from my XL2BB directly, you should just do the Step4, no more Step5~6.

And then we still have one problem.
In my example, my "RED" refers to color 3.
My "GREEN" refers to color 50.
And my "BLUE" refers to color 33.
I think we should have different RED, GREEN, or Blue very likely.

Here is my excel file to download for your reference.
color.xlsm (11.75KB) - SendSpace.com

Good luck.

Cell Formulas
RangeFormula
K2:K16K2=COUNTIF($O2:$T2,3)
L2:L16L2=COUNTIF($O2:$T2,50)
M2:M16M2=COUNTIF($O2:$T2,33)
O2:T16O2=color
I2:I16I2=IF(V2="","NONE","")
V2:V16V2=IF(AND(K2>L2,K2>M2),"RED","")& IF(AND(L2>K2,L2>M2),"GREEN","")& IF(AND(M2>K2,M2>L2),"BLUE","")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
I2:I16Expression=I2="NONE"textNO
I2:I16Expression=V2="BLUE"textNO
I2:I16Expression=V2="GREEN"textNO
I2:I16Expression=V2="RED"textNO
Please kindly help me look into this too

Thread 'how to determine "Last Drawn" and "Mix Win Streak"' how to determine "Last Drawn" and "Mix Win Streak"
 
Upvote 0

Forum statistics

Threads
1,214,830
Messages
6,121,834
Members
449,051
Latest member
excelquestion515

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