Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Adding ONLY cells of certain color
Hello!
Can anyone tell me how to add only cells of a certain color? Whether it's the cell's background color, or the font color, doesn't really matter. I researched and seemed like SumIF was the correct function, but I can't figure out how to specify only certain colors..... Thanks for your help. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Adding ONLY cells of certain color
Visit Chip at http://www.cpearson.com/excel/colors.htm
-- Bernard V Liengme www.stfx.ca/people/bliengme remove caps from email "Kentucky Insurance" wrote in message ... Hello! Can anyone tell me how to add only cells of a certain color? Whether it's the cell's background color, or the font color, doesn't really matter. I researched and seemed like SumIF was the correct function, but I can't figure out how to specify only certain colors..... Thanks for your help. |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Adding ONLY cells of certain color
Enter this UDF:
Function SumRed(r As Range) As Long Dim rr As Range SumRed = 0 For Each rr In r If rr.Interior.ColorIndex = 3 Then SumRed = SumRed + rr.Value End If Next End Function and use it like: =SumRed(A1:G4) It will sum those cells that have a red background. If you change the cell's background after you have entered the formula, you will need to manually re-calculate the worksheet: CNTRL-ALT-F9 -- Gary''s Student "Kentucky Insurance" wrote: Hello! Can anyone tell me how to add only cells of a certain color? Whether it's the cell's background color, or the font color, doesn't really matter. I researched and seemed like SumIF was the correct function, but I can't figure out how to specify only certain colors..... Thanks for your help. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
search excel for cells with a color | Excel Discussion (Misc queries) | |||
Fill cells with color based on criteria in two cells | Excel Worksheet Functions | |||
checking that cells have a value before the workbook will close | Excel Worksheet Functions | |||
Shaded cells changing color for no reason | Excel Discussion (Misc queries) | |||
HOW TO FORMATE CELLS TO COUNT CELLS WITH A FILL COLOR? | New Users to Excel |