Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
What is wrong with my UDF
I am trying to count how many in a range meet a condition. The twist
is that there is another column that the column needs to meet the condition. I wanted it as a Function so I could show my work to others who may have to view this. It calculates fine but then seems to be stuck in a loop on recalculating. Any Help? Code below. Thanks, Jay Function CountCondition(CntRng As Range, Cond As Double) As Variant Dim X As Integer Dim i X = 0 For Each i In CntRng If i.Offset(0, -4).Value = Cond And Right(i.Value, 4) = "2008" Then X = X + 1 End If CountCondition = X Next i End Function |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Insert Calculated Field (wrong Qty*Price = wrong Amount) | Excel Discussion (Misc queries) | |||
not sure what is wrong | Excel Worksheet Functions | |||
What Am I Doing Wrong | Excel Discussion (Misc queries) | |||
wHAT AM i DOING wrong | Excel Worksheet Functions | |||
What am I doing wrong? | Excel Worksheet Functions |