0

I need to count number of integers in top 1/3, middle 1/3 and bottom 1/3 of an array (test array in C6:C28). But I can't seem to get countif to work.

Range("C1").Select
    ActiveCell.FormulaR1C1 = "=MAX(R[2]C:R[24]C)"
Range("D1").Select
    ActiveCell.FormulaR1C1 = "=RC[-1]/3"
Range("E1").Select
    ActiveCell.FormulaR1C1 = "=2*RC[-1]"
Range("C2").Select
  ActiveCell.FormulaR1C1 = "=COUNTIF(R[4]C:R[26]C,""<D1"")"
Range("C3").Select
  ActiveCell.FormulaR1C1 = "=COUNTIF(R[3]C:R[25]C,"">E1"")"

185 
115 
208 
101 
2   
53  
348 
169 
10  
24  
243 
93  
357 
326 
17  
84  
253 
198 
250 
352 
51  
98  
216 

1 Answer 1

2

One possible source of error is this "=COUNTIF(R[4]C:R[26]C,""<D1"")" - you should extract the cell address from the string:

"=COUNTIF(R[4]C:R[26]C,""<""&D1)"

Same comment for the next formula.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.