Hi,
I am trying to do a countif statement that has a variable number in it. The formula works when it looks like
I am trying to make it so that the '> 10' part can be changed. I tried the below, but both come back as application-defined or object defined error 1004.
Any helpful suggestions on how to get a variable in the formula? Thanks
I am trying to do a countif statement that has a variable number in it. The formula works when it looks like
Code:
ActiveCell.FormulaR1C1 = _
"=COUNTIF(RC[-24]:RC[-1],""> 10"")/COUNT(RC[-24]:RC[-1])"
I am trying to make it so that the '> 10' part can be changed. I tried the below, but both come back as application-defined or object defined error 1004.
Code:
mprice1 = "> " + CStr(price1)
ActiveCell.FormulaR1C1 = _
"=COUNTIF(RC[-24]:RC[-1],[" & mprice1 & "])/COUNT(RC[-24]:RC[-1])"
Code:
mprice1 = "> " + CStr(price1)
ActiveCell.FormulaR1C1 = _
"=COUNTIF(RC[-24]:RC[-1]," & mprice1 & ")/COUNT(RC[-24]:RC[-1])"
Any helpful suggestions on how to get a variable in the formula? Thanks