I have a dataset where I want to write a COUNTIF
statement in Numbers (Mavericks). Specifically I want to count if a number is between 16 and 30.
So far I have tried: COUNTIF(test-array, ">15 AND >= 30")
with no luck.
Reading from the documentation:
condition: An expression that results in a boolean value of TRUE or FALSE. A condition can contain anything as long as the result from comparing it to a value in test-values can be expressed as TRUE or FALSE.
But I cannot find the correct logical and operator for the condition (tried &&
).
Best Answer
You should be able to use
COUNTIFS
instead ofCOUNTIF
, using the same range for each test-array/condition pair.=COUNTIFS(test-array,">=16",test-array,"<=30")
In the following example, the formula in A8 is
=COUNTIFS(A1:A6,">=16",A1:A6,"<=30")