# Can CF cells be counted ?

#### serge

##### Well-known Member
Hi,

I would like to know if it's possible the count CF cells ?

Here in the table below K16:T25 I have numbers that read in column, those are data corresponding to each number that are above from K4:T4.

Then under " Selection " I have numbers that are the result of selection from another sheet.

Which highlight the numbers per row.

My question is in the row ( Yellow ) from K27:T27 can the CF be counted ? Can a formula do the job ?

For example from K16:K25 9 cells are highlighted

L16:L25 8 cells are highlighted

M16:M25 6 cells are highlighted Etc....

Thank you for any help.
Excel Workbook
KLMNOPQRSTUVBOBPBQBRBS
412345678910Selection
15
161234567891012345
17445223166236991215182336445262
18227926131588375675361315222636
19192018221723162415252019221823
20343332313020212223242430313233
21191820172223162425151516171819
22202219231824251716152223182520
232022161523191817242524171520.
24162024151922182317252316202219
25222024251615191817232419182022
26
279867633313
Sheet

### Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
I asked a similar question months ago about counting cells with an interior color and I had to use VBA to get it done. So I would have to say no to just a formula you will probably have to create one in VBA

Please check this link for more information about creating your own user defined function for counting colored cells, note from what I have read, you will not be able to do this when using CF colors. rather it suggest to define your count using the same formula you used to create the CF.

hope this helps.

User Defined Excel functions to determine cell colors

~DR

Last edited:
Thank you guys I will try it

Serge.

Maybe a formula can come to the same result using the data from the " Selection " table for each number 1 to 10 for the table on the left ?

For example the number 1 in K4.

it would use the data from the " selection " table and count

1 in BO16
44 in BQ17
22 in BQ18
19 in BP19
19 in BS21
20 in BS22
20 in BR23
16 in BP24
and 22 in BS25 ?

to avoid a VBA which I know nothing about it ?

Thank you.

Anyone have an idea for my last post ?

Not sure what you mean by post #5 (or can't be bothered to work out the layout) so dealing with your table in post #1 what is the conditional format rule for column K?

Can you also explain why K4 is green in the table but not counted?

Not sure but try

=SUMPRODUCT((\$BO\$16:\$BS\$16=K16)+(K17=\$BO\$17:\$BS\$17)+(K18=\$BO\$18:\$BS\$18)+(K19=\$BO\$19:\$BS\$19)+(K20=\$BO\$20:\$BS\$20)+(K21=\$BO\$21:\$BS\$21)+(K22=\$BO\$22:\$BS\$22)+(K23=\$BO\$23:\$BS\$23)+(K24=\$BO\$24:\$BS\$24)+(K25=\$BO\$25:\$BS\$25))

Gaz_chops,

Thank you so much, your formula works like a charm, I really appreciate your help.

Serge.

You're welcome, just for info. if the cells are highlighted using a formula, then they can probably be counted using a formula.

Replies
1
Views
162
Replies
8
Views
410
Replies
10
Views
1K
Replies
22
Views
523
Replies
7
Views
242

1,206,757
Messages
6,074,760
Members
446,084
Latest member
WalmitAal

### 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.

### Which adblocker are you using?

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

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