Function by Color allows you to calculate cells coloured in a certain way in any range in Google Sheets.
To our regret, Google Sheets takes some time calculating custom formulas. If you have a large table, please wait a few seconds before the value of the built formula changes from "0" to a correct one.
The Refresh results option may also work a bit slow since it recalculates all custom formulas created by the tool in the current tab.
Go to Extensions > Function by Color > Start in the Google Sheets menu to access the utility:
Or access the add-on from the Process group:
The first tab lets you calculate values based on one selected fill and/or font color:
To change the range, just enter it manually or click the Select range icon. The latter will open a special window allowing you to pick the necessary cells:
Just click the cell of interest in your table and then hit OK.
The checkboxes next to these icons let you decide if you want to calculate cells that share Font color only, or Background color only, or both hues.
Hit Insert function to calculate all cells in the desired range based on the selected colors.
The second tab calculates cells of all colors that exist in your selected range:
Tip.If you select it in the table before running the tool, the add-on will pick it up automatically. If only one cell is selected upon running the extension, that cell will be taken as a place for the result.
You can change the range by typing it manually directly into the field. Or click the Select range icon and pick the required cells from this special window:
This is very helpful since you won't have to copy the formula to sum or count colored cells in each column/row respectively.
Hit Insert function to calculate cells of all colors in the selected range.
If there are any changes only to the formatting in the range, there are 4 ways to update calculations:
The add-on offers an opportunity to quickly edit existing formulas: change colors and a way to calculate, pick another function or even source range.
Just select a cell with a formula you want to adjust and click the corresponding option from the Function by Color menu: Extensions > Function by Color > Edit selected formula.
The add-on pane will open, featuring all settings that were used to build this formula. Tweak whatever seems necessary and hit Insert function to get the updated result in the same cell.
Besides the formula that our Function by Color creates for you, there are 2 extra functions available:
Not only do they work with colors, but also are useful for SUMIF(S) and COUNTIF(S).
Returns hex codes or the names of colors (per Google Sheets color palette) used in each cell of the range.
CELLCOLOR(range, [color_source], [color_name])
=CELLCOLOR(C2:C10,"fill",TRUE)
=IF(CELLCOLOR(C3,"fill",TRUE)="light green 3",0.1,"")
=COUNTIFS(A2:A10,"Leela",CELLCOLOR(C2:C10,"fill",TRUE),"light green 3")
Returns the entire range where only cells with the same fill and font colors contain values, while other cells remain empty. Can be used as a criteria_range in SUMIF(S), range in COUNTIF(S).
VALUESBYCOLORALL(fill_color, font_color, range)
Responses
Post a comment
Seen by everyone, do not publish license keys and sensitive personal info!