Sum if cell green

F

Frank Kabel

Hi
one way: use the following user defined function:
Public Function Sum_Color(rng as range,col_index)
Dim ret_value
Dim cell as range
For each cell in rng
If cell.interior.colorindex=col_index then
If IsNumeric(cell.value) then
ret_value = ret_value + cell.value
end if
end if
next
Sum_Col = ret_value
end Function

Call it in your worksheet with:
=SUM_COLOR(B5:B223,4)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top