If it has a value (text value) can I make it count is as 0.5 instead of 1?
Thanks for the help so far
If it has a value (text value) can I make it count is as 0.5 instead of 1?
Thanks for the help so far
Let's just clarify what you want to do exactly.
For counting cells of a given colour, non-blanks are worth 0.5 and blanks 0 ?
For summing cells of a given colour, non-numerics worth 0
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
I'm heading off line, assuming prior post is correct then below is the original condensed and altered.
Though FWIW IMO it is ill advised to differentiate / calculate based on "feel / appearance".![]()
Function ColorFunction(rColor As Range, rRange As Range, Optional SUM As Boolean) Dim rCell As Range Dim lCol As Long Dim vResult lCol = rColor.Interior.ColorIndex For Each rCell In rRange If rCell.Interior.ColorIndex = lCol Then If SUM Then vResult = WorksheetFunction.SUM(rCell.Value, vResult) Else vResult = vResult + IIf(rCell.Value <> "", 0.5, 0) End If End If Next rCell ColorFunction = vResult End Function
Change the 0 in the IIF to 1.Non blanks are worth 0.5 and blanks are worth 1
Would be better to use H (or 1) in cell to denote Holiday and HH (or 0.5) for Half Holiday - use Conditional Formatting to apply colour based on the cell value if required. No VBA required from that point forth.usings colours to display holiday days - And text within that colour to stipulate half a holiday day
Last edited by DonkeyOte; 10-19-2009 at 12:28 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks