This works. It looks for two values in different colums.



Range("D2").Value = Application.WorksheetFunction.CountIfs(Range("A7:A1206"), "WC", Range("AB7:AB1206"), "Y",)
which is the same as
=COUNTIFS(A7:A1260,"WC", AB7:AB1260,"Y")
in cell D2

but when I try looking for 4 values it comes back as unable to get the CountIfs property of the worksheetfunction class

Range("D2").Value = Application.WorksheetFunction.CountIfs(Range("A7:A1206"), "WC", Range("AB7:AB1206"), "Y", Range("F7:F1260"), "3", Range("G7:G1260"), Range("G7"))
this one is the same as

=COUNTIFS(A7:A1260,"WC", AB7:AB1260,"Y", AB7:AB1206,"Y", F7:F1260,"3",G7:G1260,G7)
in cell D2