Conditional sum

February 17, 2009 at 04:25:22
Specs: Windows XP
hi all, i have problem in Excell2003. We have 3 coloum namely A,B,C. Coloum A have Code of product , B Have Colour of product, C have a Numver of product. My problem is this , How to sumup for all A & B in C.

See More: Conditional sum

Report •

February 17, 2009 at 06:07:44
I do not know how to SUM a color.

Perhaps I do not understand the question?
Can you provide a little more specific information?


Report •

February 17, 2009 at 06:51:47
I agree that we need more info, but...

You can SUM cells by Fill Colors by using the ColorIndex property in VBA. However, if the color is caused by Conditional Formatting, it's a little tougher.

For Fill Colors, here's a simple example.

Sub ColorSummer()
'To Sum the Red cells
 For Each cell In Range("A1:A10")
  If cell.Interior.ColorIndex = 3 Then RedSum = RedSum + cell.Value
 Range("B1") = RedSum
End Sub

For a lot more detail, see here:

and here:

For a thread on working with colors caused by Conditional Formatted, see here: (Note: read the entire thread to make sure you cover all issues)

Report •

February 17, 2009 at 19:51:10
Col A Col B Col C Col D
201 777 Blk 100
203 888 red 200
201 777 grn 300
201 888 blk 100

i wan to sum up for all value for condition if col A has 201 and cob B have 777. here answer is 400.

Report •

Related Solutions

February 18, 2009 at 04:14:36

Obviously you'll need to change the size of the range

Report •

Ask Question