Thread: CountIfs
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
farid2001 farid2001 is offline
external usenet poster
 
Posts: 56
Default CountIfs

Dear Gentlemen

I am trying to get the CountBetween function to work with CountIfs instead
of CountIf, but I am getting nowhere.

This is what I have:

Function CountBetween1(InRange, num1, num2, InRange1, num3) As Integer

With Application.WorksheetFunction
If num1 <= num2 Then
CountBetween1 = .CountIfs(InRange, "=" & num1) -
..CountIfs(InRange, "" & num2) And .CountIfs(InRange1, "=" & num3)
Else
CountBetween1 = .CountIfs(InRange, "=" & num2) -
..CountIfs(InRange, "" & num1) And .CountIfs(InRange1, "=" & num3)
End If
End With
End Function

Your help will be greatly appreciated.

Regards
farid2001