If C7:C14
are
1
2
2
2
3
5
6
6
then =(COUNTIF(C7:C14,"=2"))/(COUNTIF(C7:C14,"<6"))
will display .5
which is 50%
further,
to use this in VBA you need
ActiveCell.Formula = "=(COUNTIF(C7:C14,""=2""))/(COUNTIF(C7:C14,""<6""))"
Note: you need to wrap "
with another "
to escape the double quote inside a string