Calculate based on the color of the cell

Closed
50butNifty - Oct 5, 2010 at 10:42 AM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Oct 6, 2010 at 05:56 AM
Hello,



I am trying to write an if formula in Excel 2007 that will calculate the sum of all the cells that are a certain color. Can you help me do this? For instance if the cell is green then I want to add all the green cells, yellow? add the yellow cells, red? add the red cells.

Can this be done?

Thank you!

Pam

1 response

venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 811
Oct 6, 2010 at 05:56 AM
you need a macro
see this webpage

http://www.cpearson.com/excel/colors.aspx

see this section

Function SumColor(TestRange As Range, SumRange As Range, _
ColorIndex As Long, Optional OfText As Boolean = False) As Variant
0