5

I have a dataset where I want to write a COUNTIFstatement 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 &&).

2 Answers 2

1

You should be able to use COUNTIFS instead of COUNTIF, 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")

      A     B     C     D     E
1    10
2    15
3    20
4    25
5    30
6    35
7    
8     3
1
  • 1
    thanks for the answer. just a note: I got a syntax error when I used , as a sperator for the parameters of countifs but ; seems to work fine. =COUNTIFS(B2:B38;">15";B2:B38;"<=30")
    – wpp
    Dec 3, 2013 at 12:24
2

If you don't mind a separate column/table for this, you can check if each cell is between 16 and 31 like this:

Table 2, A1:

IF(x::A1>15,IF(x::A1<31,TRUE,FALSE))

Table 2, A9:

COUNTIF(A,"=TRUE")
1
  • Thanks for your answer! But in my case I actually do mind an extra column.
    – wpp
    Dec 3, 2013 at 12:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .