Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Excell 2002 SP3 - When totaling up my rows and columns I want Excel to ignore
any numbers I make red. ( I still want to see them - just not have them included in the totals ) Thank you, Chris |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Chris,
You can do this only with code: Function SumExceptColor(InputRange As Range, ExcludeCI As Integer, _ OfText As Boolean) As Double Dim Rng As Range Dim Total As Double For Each Rng In InputRange.Cells If IsNumeric(Rng.Value) = True Then If OfText = True Then If Rng.Font.ColorIndex < ExcludeCI Then Total = Total + Rng.Value2 End If Else If Rng.Interior.ColorIndex < ExcludeCI Then Total = Total + Rng.Value2 End If End If End If Next Rng SumExceptColor = Total End Function In this function, InputRange is the range to sum. ExcludeCI is the ColorIndex to exclude from the summation (Red = 3), OfText indicates whether to look at the color of text (if OfText = True) or the background (if OfText = False) of each cell. You can call this function with =SumExceptColor(A1:A10,3,TRUE) -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting LLC www.cpearson.com (email on the web site) "Chris Douglass" <Chris wrote in message ... Excell 2002 SP3 - When totaling up my rows and columns I want Excel to ignore any numbers I make red. ( I still want to see them - just not have them included in the totals ) Thank you, Chris |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
totaling numbers of a cell | Excel Discussion (Misc queries) | |||
Can I ignore numbers and sort only text in an Excel column? | Excel Discussion (Misc queries) | |||
Excel Formula - Add column of numbers but ignore negative numbers | Excel Worksheet Functions | |||
Ignore Hidden Rows on Sum Function on Excel XP | Excel Discussion (Misc queries) | |||
When using Autofilter on Excel, how do I ignore 1st 1 or 2 rows | Excel Worksheet Functions |