Count By Color

DPChristman

Board Regular
Joined
Sep 4, 2012
Messages
181
Office Version
  1. 365
Platform
  1. Windows
I have a formula that counts all cells with a specific color fill.

The formula is this:

=@CountCellsByColor($V$2:$V$54,$P4)

$V$2:$V$54 is the range of rows to be counted by color.

$P4 is the cell address with the matching color.

This formula has worked successfully for years.

Suddenly, today, I am getting a #NAME? error.

Any thoughts as to what the issue might be, or a better formula to get the results?

Thanks in advance.
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
That means it is not recognizing the function.
"CountCellsByColor" is not a native Excel function. It is probably either a User Defined Function (UDF) that was added in VBA, or part of some Add-In.
Did you verify that you have this function defined in your VBA or part of an add-in you are using.
 
Upvote 0
That means it is not recognizing the function.
"CountCellsByColor" is not a native Excel function. It is probably either a User Defined Function (UDF) that was added in VBA, or part of some Add-In.
Did you verify that you have this function defined in your VBA or part of an add-in you are using.
Not sure how to confirm that, but this formula has worked for years. To add to the confusion, this is a weekly file that I create, and when I pulled up previous versions of the file that I have created, the formula worked they now show the same error. I have made no changes to any of these files.
 
Upvote 0
Check to see if your VBA code has been disabled. Sometimes updates can disable them, by default.
If Macros/VBA has been disabled, it won't be able use those functions in VBA.
See here: Enable or disable macros in Microsoft 365 files - Microsoft Support
Ok, I did that and I get this error message. I guess I have to go through my IT department.

Thanks

1737388345814.png




1737388297631.png
 
Upvote 0
Yeah, you will have to get those settings changes if you still want to be able to use that function in your workbooks.
 
Upvote 0
That message has nothing to do with macro settings. If they aren't greyed out, and they aren't in your picture, you should be able to edit them.

The message relates to this setting:

1737391724208.png
 
Upvote 0

Forum statistics

Threads
1,226,099
Messages
6,188,901
Members
453,510
Latest member
LarryWB423

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