i was wondering if there is a function in Excel that counts all the unique values from a list that meet a given criteria?
ie Count the unique items in column D that have and x in the offsetted cell in column C?
Is there anything better than the below (extremely slow) custom function that is by no means perfect
Public Function CountSingle(InputRange As Range, Criteria1 As String, _
InputOffset1 As Integer, Criteria2 As String, InputOffset2)
Dim c As Range, counter As Double
For Each c In InputRange
If c.Offset(0, InputOffset1).Value = Criteria1 Then
If c.Offset(0, InputOffset).Value = Criteria2 Then
If c.Value <> c.Offset(1, 0).Value Then
counter = counter + 1
CountSingle = counter
Any assistance would be highl appreciated.