Below is an VBA function to calculate unique values count (Credit to SO: Count unique values in Excel) is it possible to add criteria paramaters? Like in the function "countifs"?
Public Function CountUnique(rng As Range) As Integer
Dim dict As Dictionary
Dim cell As Range
Set dict = New Dictionary
For Each cell In rng.Cells
If Not dict.Exists(cell.Value) Then
dict.Add cell.Value, 0
End If
Next
CountUnique = dict.Count
End Function