Jeff --
It's
=SUMPRODUCT((A2:A100="joe")*(B2:B100="Widget1"))
Aladin
========
It returns NUM#. Also, is there a way to put a wildcard in there like Widg* so that it returns any type of Widget?
It returns NUM#. Also, is there a way to put a wildcard in there like Widg* so that it returns any type of Widget?
> It returns NUM#.
You probably tried using A:A and B:B as arguments. That is not allowed in sumproduct formulas. You must feed it with a real range. However, if you insist having A:A and B:B, let me know. There is a workaround it using an UDF.
> Also, is there a way to put a wildcard in there like Widg* so that it returns any type of Widget?
Yes. The formula then will be:
=SUMPRODUCT((A2:A100="Joe")*(ISNUMBER(SEARCH("Widget",B2:B100))))
Aladin
=========
This might help
Sub Countit()
Application.ScreenUpdating = False
Dim key1
Dim key2
key1 = InputBox("What do you want to search for in the first column?")
key2 = InputBox("What do you want to search for in the second column?")
Y = 0
For x = 1 To 100
Range("A" & x).Select
If ActiveCell.Value = key1 Then
Range("B" & x).Select
If ActiveCell.Value = key2 Then
Y = Y + 1
End If
End If
Next x
MsgBox "There Are " & Y & " Matches To Your Query"
End Sub
Jacob