How to use Functions by Color in Google Sheets

There are no built-in options in Google Sheets that function on cells based on their formatting. There are a few crude methods to use functions by color, but these are not super-intuitive. Enter Power Tools.

How to Functions by Color in Power Tools

Power Tools is an add-on that gives our Google Sheets extra abilities, one of them being the ability to sum, average, et cetera, based on color, as explained in đź“şthis video.

All units below 50 have a green font in the following dataset, while those above 50 have a red font (column D). How would we sum all the green values?
red and green font in your spreadsheet

As mentioned, we need to use Power Tools.

Power Tools menu showing to the right of the screen

After installing Power Tools, you can launch it via Add-ons > Power Tools > Start

After starting Power Tools, let’s find the total of all units that have a green font. First, we should highlight the range to which we want to apply a function. In our case, that’s D2:D10. Next, head over to the Power Tools sidebar, click on the red underlined summation icon, and select “Function by color”.

Icon to click to use functions by color

SUM by Color

After clicking “Function by color”, we need to adjust the settings to match the formatting of the cells we want to work with. After changing the settings, we should set the background color to white and the font color to green (The actual name for the color is lime but, the most important thing is to make sure they are a visual match). There are quite a few functions we can apply to the selected range, but in our case, we’re interested in the SUM function.

parameters for using functions by color

Lastly, we click on “Insert function”. As a result of clicking on “Insert function”, a custom formula will appear on cell D11, and it computes the total of all values that have a lime font.

Notes on Power Tools

results of the function

Things to note:

  • The formula only recalculates if one of the values in the range changes. Therefore, any formatting changes will not trigger a recalculation until you modify one of the values.
  • As aforementioned, you can apply other functions such as AVERAGE and PRODUCT.

Disclosure: This is an independently owned website that sometimes receives compensation from the company's mentioned products. Prolific Oaktree tests each product, and any opinions expressed here are our own.

AutoSum Function in Google Sheets

You may be looking for AutoSum in Google Sheets, but you won’t find it in the built-in menus.

AutoSum in Excel

Traditionally in Microsoft Excel, you would sum, multiply or divide values in a range by keying in the respective function and then specifying the range. You would add the total number of units In the following dataset by applying the formula, “=SUM(D2:D10)“.

column being SUMMED in Excel

However, as demonstrated in đź“şthis video, Excel provides a built-in intelligent function that automatically detects the range we wish to sum, known as AutoSum. If we place the cursor on cell D11 and click on AutoSum, Excel will figure out on its own that we intend to sum the range, D2:D10.

column of numbers being highlighted with autosum

 

AutoSum in Google Sheets

Could we do the same in Google Sheets? Well, it’s not as impressive as in Excel. Instead of auto-detecting the range, Google Sheets merely inserts the specified function without the range.

the SUM function appearing in Google Sheets

We could solve this problem using a third-party add-on known as Power Tools.

 

AutoSum in Google Sheets using Power Tools

To install Power Tools, click on this link.

After you install Power Tools, you can launch it via Add-ons > Power Tools > Start.

 

function menu in Power Tools

 

Now that we have the plugin installed, we can repeat the AutoSum operation we did in Excel. To achieve this, click on the cell that needs to add up the total. In our case, we want to get the Units total, so the cell is D11. Now that you have selected the units, head over to the sidebar and click on the AutoSum icon, ÎŁ (not to be confused with the red-underlined ÎŁ). Next, click on SUM in the drop-down that appears. After clicking, the total automatically appears in the cell we selected.

 

the result of autosum in Google Sheets using Power Tools

 

Things to note:

  • You can execute operations besides addition using the Power Tools add-on. The drop-down next to the icon provides a wide selection of functions to apply.
  • There’s an AutoSum by color function in  Power Tools, which sums values based on background color and the text color. Find more on that here.

Disclosure: This is an independently owned website that sometimes receives compensation from the company's mentioned products. Prolific Oaktree tests each product, and any opinions expressed here are our own.