Suming cell with colour.

Peter1973

Well-known Member
Joined
May 13, 2006
Messages
933
I have a row of cells A1:A10 then in A11 I have simple formula
=SUM(A1:A10)

Is there a formula I could use that would detect if one of the cells was fomated to a certain colour ie yellow that would then add 8 to the answer.

So if A1:A10 total was 35 but A8 was formatted yellow the toal would be 43.
 

Some videos you may like

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Greg Truby

MrExcel MVP
Joined
Jun 19, 2002
Messages
10,014
Also, if you want a listing of what all the colors are, there's one in this wiki entry.
 

Peter1973

Well-known Member
Joined
May 13, 2006
Messages
933
Thanks for the help my knowledge of vba is small enough to fit on a stamp but im trying to get to grips with the info on the links.

Thanks
 

Greg Truby

MrExcel MVP
Joined
Jun 19, 2002
Messages
10,014
Obviously the relevant one of Chip's UDF's listed there is SumByColor. This one is a very well-known UDF by now. So if you just do a search here on SumByColor you'll get plenty of threads related to its usage/implementation.
 

Watch MrExcel Video

Forum statistics

Threads
1,113,811
Messages
5,544,437
Members
410,610
Latest member
renatha prado
Top