Google Sheets – Sum Colored Cells in a Column

formulasgoogle sheets

I have a column of numbers, where I've changed the background color of some of the cells to blue. All of the other cells in the column have the regular white background.

Is it possible to create a formula to add up only the colored cells in the column?

Best Answer

It seems what you really want to do is 1) mark certain rows and then 2) sum the marked rows. On any spreadsheet, it makes the most sense to create another column and put a number or character in there. Then use the SUMIF formula to calculate the result.

Imagine having a 4 row by 2 column spreadsheet. You want to sum the values in column A if there's a Y in column B.

A      | B
---------------
40     | Y
20     | 
30     | Y
10     | 

To calculate the sum, the formula is as follows:

=SUMIF(B1:B4, "Y", A1:A4)