Forum Discussion
sumar.si
Hi people!
I would like to know how to use the formula sumar.si to add values that are in cells color Green(for example).
Ty
- Arul TresoldiIron Contributor
I am not sure if that is possible to do without applying filters and adding cells that simple sums values with or without color formats... check attachement!
- Buddhadeb deCopper Contributor
Hi
i have same kind report where need to do same task so i was made custom function in VBA and i have save as like excel add-in . so i hope it will help .
below code need to add in VBA its working fine.
Function getsumbycolor(lookupcolor As Range, lookuparray As Range) As LongLong
Dim colorsum As LongLong
Dim colornumber As LongLong
Dim rg As Range
colorsum = 0
colornumber = lookupcolor.Interior.Color
For Each rg In lookuparray
If rg.Interior.Color = colornumber Then
colorsum = colorsum + rg.Value
End If
Next rg
getsumbycolor = colorsumEnd Function
Thanks
Buddhadeb De