Function Countif problem in Numbers for Mac

I have a populated spreadsheet in which I want to find all number above and below a particular number. According to the Function Browser, the function COUNTIF definition would be the function of use.

COUNTIF

The COUNTIF function returns the number of cells in a range that satisfy a given condition.


  • COUNTIF(test-array, condition)
  • test-array: The collection containing the values to be tested. test-array is a collection that can contain any value type.
  • condition: An expression that results in a logical TRUE or FALSE. condition is an expression that can contain anything as long as the result from comparing condition to a value intest-array can be expressed as a Boolean value of TRUE or FALSE.

However, the test I want to use; > or < (greater than, less than) give me a syntax error message.


What is the proper methodology to accomplish my requirement?


Sparkgapper

iMac, OS X Mountain Lion (10.8.5), DualBoot with Snow Leopard

Posted on May 14, 2015 11:21 AM

Reply
6 replies

May 14, 2015 12:31 PM in response to Sparkgapper

Spark,


the countif() function can conditionally count based on a single boolean condition.


You have specified "... find all number above and below a particular number..". The AND portion of your requirement implies you want to count when two conditions are met:

1) number X is greater than A

2) number X is less than B


in this case you want to use countifs() like this:


=countifs(<value1>, <cond1>, <value2>, <cond2>)


for your problem <value1> and <value2> are the same and

<cond1> is the concatenation of the string containing the boolean test "<10" (change the value 10 as needed)

<cond2> is the concatenation of the string containing the boolean test ">5" (change the value 5 as needed)

So...

=countifs(<cells with X>, "<10", <cells with X>, ">5")


this will count when the cells with X are greater than 5 AND less than 10

May 14, 2015 2:31 PM in response to jaxjason

Aged brain not quite up to very high logic at the present time. Took me a while to discover that those sets would do exactly what I want to do and then some as it answered my question, albeit inferentially, about WHAT TO USE FOR THE TEST, that there are no symbolics involved, just the numbers such that using them as shown will equate to the ancient programming of "from-through".


Give both of you "Solved"


tks

Sparkgapper

May 14, 2015 2:37 PM in response to Sparkgapper

Just for info, I did a search of the community for "COUNTIF" and found nothing. Also did the normal Question for "COUNTIF" and nothing there either and I was sure this question would have been asked before now. BTW; I am a long associate with numerous Spreadsheets, some not defunct because their OSs are no longer in existence, but more recently with ClarisWorks/AppleWorks (I still have this on an ancient 17' Dome Mac but before that beginning with the old IIgs.


Tks

Sparkgapper

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Function Countif problem in Numbers for Mac

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.