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?
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”.
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.
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
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.
You can have complete control over the look and feel of the numbers in your spreadsheet by using custom number formatting in Google Sheets. You can follow this example by starting with this template.
This article will walk you through the process of customizing the appearance of the numbers in your spreadsheet. Accordingly, it will teach you how to control your numbers’ visual presentation with currency signs, arrows, and more. Changing the look is called Custom Number Formatting. To have a comprehensive understanding of Custom Number Formatting, see this video from the Prolific Oaktree Youtube Channel.
Besides the default look, which presents your data in the black font color, you can infuse some level of creativity in your presentation by assigning different font colors to enhance the message of your presentation. For instance, you may want to present debits in red and credits in green.
Take a look at the image below.
The data in red have a minus sign (-) before each, which indicates negative, hence, the use of red. On the other hand, the data in green is positive.
Changing the number formatting allows you to change the look, but the values of each cell will not change. It only gives it a different appearance through the color assigned to individual rows of data.
How To Custom Format Your Numbers in Google Sheets
The procedure is simple; locate your menu bar at the top of your spreadsheet and select Format>Number.
After the number format menu appears, you will notice that there is a preset format for the display of your data. If that is what you want, you do not need to change anything. Just click on it, and you have your option activated.
However, if you want to give the data in each of the cells on your spreadsheet a custom look, you need to dig deeper. We will walk through how to get that done.