Add colored cell values in column

Closed
Report
-
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
-
i want to add cell values in a column which are of red font color.
for ex. i have a column a of range a1 to 10 and values are below and 20,50,70,100 are of red color font . I want to add only these values of red color i.e total should be shown 240 in cell B12
A B
10
20
30
40
50
60
70
80
90
100


3 replies

still waiting for ur favourable respond after writing appology and reactivate letter tosupport@facebook.com
0
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
Are they red due to some conditional formatting or have been colored red. If due to conditional formatting, what is the condtion
0
no they are red by manually and there is no conditional formatting in the column.
0
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
Paste this formula

Function MySum(mySumRange As Range) As Variant
Dim sum As Variant

    For Each cell In mySumRange
    
        If (cell.Font.color = RGB(255, 0, 0)) Then
            sum = sum + cell
        End If
    
    Next
    MySum = sum
    
End Function



and then in your cell B12 write

=MySum(A1:A10)
0