Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
HI
I need to count the values between a set value, and then only show how many times this count was more than 5. The values counted is variable only the between value is set This is in the same column lets say from a1. DD is your set value, in the below example my answer should be 2 ( there are only 2occurrences where there are more than 5 data sets between the DD parameter) 1 5 4 7 DD 7 5 2 9 7 1 5 3 1 1 2 DD 6 8 7 1 DD 7 5 2 9 7 1 5 3 1 1 2 DD 6 8 7 Thank you Gerhard |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]() |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi again,
Am Fri, 3 Jun 2016 17:12:17 +0200 schrieb Claus Busch: try it with an UDF: Function CntSeries(myRng As Range) As Long sorry, there is an error in the function. Better try: Function CntS(myRng As Range) As Long Dim varMatch() As Variant Dim myCnt As Long, i As Long Dim myRows As String myRows = "1:" & myRng.Rows.Count myCnt = Application.CountIf(myRng, "DD") ReDim varMatch(myCnt - 1) For i = 1 To myCnt With Application varMatch(i - 1) = _ Application.Evaluate("=small(if(" & myRng.Address & _ "=""DD"",row(" & myRows & "))," & i & ")") End With Next For i = LBound(varMatch) To UBound(varMatch) - 1 If varMatch(i + 1) - varMatch(i) - 1 5 Then CntS = CntS + 1 End If Next If myRng.Rows.Count - varMatch(UBound(varMatch)) - 1 5 Then CntS = CntS + 1 End Function Regards Claus B. -- Windows10 Office 2016 |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]() |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
COUNTIFS ? | Excel Worksheet Functions | |||
Countifs | Excel Worksheet Functions | |||
Countifs to Sumproduct for 2003 - was Simple Countifs.. from Fr | Excel Worksheet Functions | |||
Two COUNTIFs | Excel Discussion (Misc queries) | |||
countifs | Excel Programming |