How to sum numbers in a range that only have a particular cell color [Excel]?

3

1

I would like to put a formula in Excel that would sum all the numbers of a specific range that have a specific cell background color.

jason

Posted 2010-03-18T19:12:57.400

Reputation: 457

3Always consider how you can restructure your data before trying to fix the analysis process. You are better off taking the information that you are encoding as a color and making it explicit in another column or something equivalent. – mindless.panda – 2010-03-18T19:22:46.017

Answers

1

There is no way to return the exact color of a cell using built-in Excel functions, only if the cell is colored or not.

To do this you have to use a user defined function that can return the color of the cell, like this example. Another useful link is here which indicates even these user defined functions might have problems if the cell is colored via conditional formatting. Again, I recommend instead of coloring by hand or by conditional formatting to indicate some state, you make that state itself part of the data.

Perhaps a workaround is to consider what criteria you are using to apply formatting, and instead use that criteria for some sort of filter.

mindless.panda

Posted 2010-03-18T19:12:57.400

Reputation: 6 642

I was going to say this exact same thing, but then I saw rlb.usa demonstrate provably that you can indeed base a sort on the color of the cell. Color me impressed! – Nathan DeWitt – 2010-03-18T20:15:10.460

1

You can select all of the cells and do a sum. Here's how to select them:

In Excel 2007

rlb.usa

Posted 2010-03-18T19:12:57.400

Reputation: 1 430

The order of the cells cannot be changed, but thanks anyway. – jason – 2010-03-18T21:31:38.573

0

Search the web for an Add-in called xCELLcolor. It exposes four helpful functions to Excel 2007-2013: Sum by background color, count by background color, sum by font color, and count by font color. No need for VBA or macros and no need to re-sort your data.

FullScope Solutions

Posted 2010-03-18T19:12:57.400

Reputation: 1

1Note that this is a commercial solution provided by FullScope Solutions. – dangowans – 2012-09-16T14:50:27.563