Count by Color in Google Sheets
Hello everybody!
Are you familiar with the function COUNTIF in Google Sheets? You can count how many cells match a certain criteria from a range. But what if what you need is to count the color of the cells? That is not currently possible.
I came across a situation in which I had applied individual conditional formatting to 25 different columns. The words didn't match amongst them, but the colors were the significant piece. I needed to count how many cells had a certain color.
I Googled and looked to see if anyone had gone through a similar situation. Yay! I came across exactly what I needed!
Count Cells by Color (link here!)
Here's the website I found. It shows 3 different methods. I chose to use Method 1. This method requires you add a script to your sheet. The link provides the script. All you have to do is copy/paste and follow the instructions.
Once you have added the script you can start using the new function "=countColoredCells(RANGE, DESTINATION COLOR)". Works similar to COUNTIF in which you need to determine the range and then the criteria (destination color). In this case, the criteria is a color. All you'll need to do is establish a color key. Add color to a cell, then use that cell address for the destination color.
I would recommend you create a separate tab only for the color keys, then just hide it from view.
Hope you find this helpful!
Cheers!
Comments
Post a Comment