# sum based on cell colour

#### Hannah

##### Board Regular
Hi,
just wondering how to go about summing a number of values in a column based on the background colour of the cell.

For example, say i have a list of numbers in column A starting at the cell A20, and a number of the values in this list are in cells that are a different colour, say red.

What i want to do is calculate the sum of only those values that are in red cells and insert that total in the first empty cell after the list of numbers.

I've tried a number of things but i'm way off the mark...can anyone get me back on track?

Thanks
H...

### Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Hi Hannah,

I am not that great at this stuff, but I can think of one way to do it.

Firstly, why would the cells be red, is this a conditional format?

If so, your cell where the answer goes could be something like

=sumif( then the formula from the conditional format)

Any help?
This message was edited by The Idea Dude on 2002-09-11 19:33

There's just one problem....I don't know much about functions but i'd already had a look at that site and decided that it wasn't for me....this was based mainly on my complete lack of knowledge of UDFs

So what i can gather is they're used like other stuff like SUM, AVG etc etc??? Is that right???

If that's the case i don't think that's what i'm after....I just wanted to do it through a macro and slot it into some other stuff i'm doing. If i use all that code i'd have to write more to get it doing what i want it to and i thought it was a bit more simple...

I know now i'm rambling....i just don't think i should use all that stuff if i don't understand it if you know what i mean....

is there a way i can do it in an everyday macro?

Replies
8
Views
203
Replies
10
Views
275
Replies
1
Views
140
Replies
3
Views
286
Replies
3
Views
133

1,207,013
Messages
6,076,151
Members
446,187
Latest member
LMill

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back