Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Kentucky Insurance
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
Bernard Liengme
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student
 
Posts: n/a
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
search excel for cells with a color john mcmichael Excel Discussion (Misc queries) 1 January 17th 06 03:51 PM
Fill cells with color based on criteria in two cells AA Excel Worksheet Functions 2 January 2nd 06 11:29 PM
checking that cells have a value before the workbook will close kcdonaldson Excel Worksheet Functions 8 December 5th 05 04:57 PM
Shaded cells changing color for no reason VA Excel Discussion (Misc queries) 0 December 2nd 05 07:41 PM
HOW TO FORMATE CELLS TO COUNT CELLS WITH A FILL COLOR? Moore New Users to Excel 1 June 15th 05 06:41 PM


All times are GMT +1. The time now is 10:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"