Web Applications Stack Exchange is a question and answer site for power users of web applications. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
Can't you use conditional formatting to change the colour according to some text in the cell, which the formula also counts? – Gelatin Jul 1 '10 at 17:19
up vote 6 down vote accepted

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)
share|improve this answer
That's a great idea and should work wonderfully in my case. Thanks! – bporter Jul 1 '10 at 18:09
This only works if you have two columns - "A" and "B". If you have two points of data and one of them is the value, the second being the color of the cell, then this solution will not work. Sometimes it is not possible to have two columns. – user37950 Apr 8 '13 at 14:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.