Count number of cells in a cell range that has a particular color

myletterboxnp

New Member
Joined
May 20, 2022
Messages
28
Office Version
  1. 365
Hi all,

A2:A20 cells have different colors such as red, green and yellow.

In A22, what should be the formula to count the number of the red cells in the range A2:A20
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Thank you so much for your help - it worked! and please pardon my ignorance.
No worries!

I am glad we got it sorted out.
There is an awful lot in that initial link, and it can be easy get overwhelmed. But we really only need a small part of it, and we don't even need to know how to write or understand the code, just to copy and paste and use it "as-is".

There are two main things you can create with VBA:
1. Macros (also known as "Procedures") - these are a bunch of steps that can be run either manually or automatically (dependent upon some conditions)
2. User Defined Functions (UDF)- there are our own functions that work the same like any other Excel functions (to be used in formulas)

What we used here was a UDF that someone else created. So we just needed to "plug-and-play"!
 
Upvote 0

Forum statistics

Threads
1,216,591
Messages
6,131,629
Members
449,658
Latest member
JasonEncon

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