sum based on cell colour

Hannah

Board Regular
Joined
Aug 20, 2002
Messages
51
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

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
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
 
Upvote 0
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 :smile:

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?
 
Upvote 0

Forum statistics

Threads
1,224,271
Messages
6,177,610
Members
452,785
Latest member
3110vba

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top