How to use =CELLCOLOR() & =VALUESBYCOLORALL() in Google Sheets
Learn 2 new Google Sheets functions: CELLCOLOR & VALUESBYCOLORALL. They let you process colored cells in any of your own formulas. Get Function by Color from the store: https://gsuite.google.com/marketplace/app/function_by_color/431807167189
Or have it with other 30+ add-ons:
https://workspace.google.com/marketplace/app/power_tools/1058867473888
Learn more about Function by Color on our website:
https://www.ablebits.com/google-sheets-add-ons/count-colored-cells/index.php
Make a copy of the file from this video:
https://docs.google.com/spreadsheets/d/1w2yN9gDI-KNiF8TMNgDma5OG3hLX4zH5TIZFeQCU3Go/copy?usp=sharing
00:04 Intro to new custom functions
00:28 Introducing CELLCOLOR & VALUESBYCOLORALL
00:54 Our data
01:09 CELLCOLOR syntax explained
01:47 VALUESBYCOLORALL syntax explained
02:51 CELLCOLOR in use (SUMIFS/COUNTIFS with colors)
03:36 VALUESBUCOLORALL in use (SUMIFS/COUNTIFS with colors)
03:57 Wrap-up
👋 Let's be friends on socials!
LinkedIn: https://linkedin.com/company/apps4gs/
Facebook: https://www.facebook.com/ablebits/
#googlesheets #spreadsheet #ablebits
Closed Caption:
If you use our Function by
Color add-on for Google Sheets,
you most likely find it useful
to sum and count colored cells.
Upon your requests, we've added
2 new functions
that will let you consider cell colors in any of your own formulas.
For example, you will count
cells not only by their colors
but also by their contents and even
the related values from another column.
These functions are: CELLCOLOR
and VALUESBYCOLORALL.
CELLCOLOR checks fill, font, or both
colors in all selected cells,
and returns the names of these colors for each cell.
VALUESBYCOLORALL returns the range of the same length as your source data,
but only cells with the required fill & font colors contain values.
Let's see how you will benefit from
these 2 extra functions in spreadsheets.
Here I have a sample of weekly profits
earned by different managers
on different shifts.
Now, since the functions
are custom-made,
you must have either Function by Color or Power Tools installed.
No need to run the add-ons though.
Just pick a cell,
enter an equal sign,
and start typing the name of the function: CELLCOLOR.
This function needs 3 arguments.
Start with a range that you
want to scan for colors.
Then in double-quotes define whether
to get fill color, font color, or both at the same time.
Last but not least, is a way
to have those color names.
Enter FALSE to get them
as the RGB codes
and TRUE for the color names themselves, such as 'red'.
I close the brackets, hit 'Enter',
and I get the name of the fill color used in each cell of column C.
Moving on to VALUESBYCOLORALL.
When you start entering its name, you'll
see VALUESBYCOLOR first.
That's the function used by
the add-on itself.
You need the second one: VALUESBYCOLORALL.
There are 3 arguments here as well.
The first is the name or the RGB code of the required fill color.
You can check it if you select
a cell of interest,
open the 'Fill color' tool, and hover your mouse over the selected color.
There, 'light green 3'.
That's what I enter in double quotes.
The same goes for the second argument: font_color.
Since all my numbers are black and the font color doesn't really matter,
I can enter empty double quotes
to ignore it.
Lastly, I select the range to process,
close the brackets, and hit 'Enter'.
The function takes the range
of the same size as it handles,
but returns values only from
those positions
that correspond to the colors I set.
So how do these functions
work in your own formulas?
Let's try and sum only Leela's
profits that are colored green.
I actually have these formulas
ready, so let me just unhide them.
Here: in I2 I embedded CELLCOLOR
in SUMIFS.
It sums numbers from column C only if the same row in column B contains 'Leela'
and if cells in column C
are colored green.
That's where I use
the CELLCOLOR function.
It becomes the criteria range for SUMIFS.
It gets all fill colors from column C
(just like I showed you earlier in column E)
and SUMIFS checks which of them are 'light green 3'.
The same applies to COUNTIFS in J2.
Our CELLCOLOR works as one of
the criteria ranges
so you could check cells for their colors.
As for VALUESBYCOLORALL in I3 and J3,
it is used in the exact same way –
as a criteria range.
However, since it returns records for the
required color (like here in column F),
I modify the last criteria:
sum only non-blank cells
returned by VALUESBYCOLORALL.
These are just a couple of ways
to use these custom functions.
Install Function by Color or
Power Tools to your Google Sheets
to process colored cells easily
on a daily basis.
And if you have any questions, please
contact us – we'll be happy to help!
Video Length: 04:14
Uploaded By: Ablebits
Published: 10/28/2021
View Count: 66,176