There is no way to do that within Excel itself. You would need to use a VBA macro and that, depending on what you are trying to do, may be a tad cumbersome.
Here is a macro that, when activated, will ask for a cell reference and for a background colorindex number. Then the sum of the value in all cells with that background color will be placed in the cell you select.
It tabulates values in Column A based on cell interior color and places the sum in the cell you select. If you want to use a different column, change the 'A' in Line 3 of the macro from 'A1' and 'A' to your column letter.
I have only included a few color index codes in the inputbox. You can use any number from 1 to 56. Here is a link to a complete index if you wish to view them:
http://www.mvps.org/dmcritchie/excel/colors.htm
Open the workbook.
Copy this macro to the clipboard
Sub SumByColor()
Dim rng As Range
Set rng = Range("A1:" & Range("A" & _
ActiveSheet.Rows.Count). End(xlUp).Address)
CellSelect = InputBox("Enter a cell reference number")
selcolor = InputBox("Enter a color index to sum." & _
Chr(10) & Chr(10) & "Red: 3" & Chr(10) & _
"Lt Turquoise: 34" & Chr(10) & _
"Lt Yellow: 36" & Chr(10) & _
"Lt Blue: 37" & Chr(10) & "Lt Green: 35")
rng.Select
For Each cell In Selection
If cell.Interior.ColorIndex = Val(selcolor) Then
SumTtl = SumTtl + ActiveCell.Value
End If
Next
[A1].Select
If SumTtl = 0 Then
MsgBox "No cells with that background color."
Else
Range(CellSelect).Value = SumTtl
End If
End Sub
Press ALT + F11
Insert > Module
Paste the macro into the module space to the right.
Close back to Excel
Go to Tools > Macro > Macros
Highlight this macro if it is not already highlighted.
Click 'Options'
Select a letter to be used as a keyboard shortcut.
Close back to Excel.
Press CTRL + Your letter to run the macro.