You don't Scott. Sumproduct doesn't work as an array formula in VBA. Array
formulas are not supported in VBA. You can use Evaluate as already
instructed, but if you do, there is no reason not to use your original
formula
res = Evaluate("COUNT(IF((B2

12>0)*(B2

12<=2),B2

12))")
If you want to make 0 and 2 as variables
var1 = 0
var2 = 2
res = Evaluate("COUNT(IF((B2

12>"& var1 & _
")*(B2

12<=" & var2 & "),B2

12))")
so the argument to evaluate is a string value that would be a legitimate
formula if entered in a cell. You can use concatenation to build that
string and concatenate your variables into it. To use SUMPRODUCT, you would
use the same princple as above - built a legitimate formula string.
--
Regards,
Tom Ogilvy
Scott P said:
Thanks for the help, Pascal and Frank. In terms of VBA support for that
syntax, the following statement works for me in VBA: Result =
Application.SumProduct(Array1, Array2)
I need to insert criteria into the SumProduct function using references to
variables. For example, I would like the following to work: Result =
Application.SumProduct((Array1 > 0), (Array2 <= 2)) but it does not function
properly.