This is particularly bad spreadsheet design. There is NO inbuilt way to count colours in excel - you would be far better off adding a text / numeric indicator to a cell in the same row as the data - this could then be used to do the conditional sums (which, in reality is what you are asking for). BUT - it can be done via a sub or UDF and being as it would probably be too time consuming to change this spreadsheet, here ias a UDF that will sum coloured cells but please bear this in mind for future reference. Colour is for viewing purposes only - you should really try and use hard data to categorise other data
Function sumcol(rng As Range, clr As String)
Dim ctrCol As Integer
Dim tempsum As Long
tempsum = 0
Select Case UCase(clr)
Case "RED"
ctrCol = 3
Case "YELLOW"
ctrCol = 6
Case "BLUE"
ctrCol = 5
Case "GREEN"
ctrCol = 4
Case "PURPLE"
ctrCol = 13
Case "PINK"
ctrCol = 7
Case "GREY"
ctrCol = 15
Case Else
sumcol = "Invalid Colour selected"
End Select
For Each c In rng
If c.Interior.ColorIndex = ctrCol Then
tempsum = tempsum + c.Value
Else
End If
Next
sumcol = tempsum
End Function
Please note that this will only work for those colours that I have entered - if you need to be able to use more colours, run this sub:
Sub listcols()
For i = 1 To 56
Range("A" & i).Interior.ColorIndex = i
Next i
End Sub
this will show all colours and the ROW number that they are on will refer to the would be what you assign to ctrcol in the function
To use the function, you would enter something like
=sumcol(A1:A100,"red"

which will sum all values in red in A1:A100
Rgds
Geoff
"Some cause happiness wherever they go; others whenever they go."
-Oscar Wilde