Help with COUNTIF syntax pls

In this example from Apple Numbers, I am trying to use the COUNTIF function to calculate the value in cell C1. If I hard-code the if-condition, the formula works fine: COUNTIF(A1:A4,">150")


But I want the formula to use a cell reference, not a hard-coded value. In other words, "count the number of values in A1:A4 that are greater than the value in cell B1. I thought something like this would work, but it doesn't: COUNTIF(A1:A4,>B1).


Can anyone help with the correct syntax? Thank you.


MacBook Pro

Posted on Jan 31, 2020 7:53 AM

Reply
6 replies

Jan 31, 2020 5:22 PM in response to pomme4moi

Hi pomme'


"do you know whether COUNTIF can be used with AND/OR operators?"


COUNTIFS counts items only if ALL conditions are met.


For OR condition, use a SUMmed series of COUNT statements.


Examples:

The formula shown below the table counts all values in column B that are less than the value in B8 (700) AND greater than or equal to the value in B3 (200):

For OR counts where there is no overlap between the groups, you can use the sum of two or more COUNTIF statements, as shown below this table:

IF counts where some values may meet more than one of the listed conditions can be accommodated using an auxiliary column continig an OR statement that will return TRUE for values meeting any of the required conditions, then using COUNTIF to count the 'true' results in that column:

The first formula is entered in C2, then filled down to the end of column C.


The COUNTIF formula is in D2.


The auxiliary column (C) may be hidden.


Regards,

Barry




Feb 2, 2020 3:02 AM in response to pomme4moi

I think you'll find any formula whose syntax includes the the word 'expression' and the description 'any expression that returns 'true' or 'false' can use AND or OR as part of that expression.


The 'operationIF' functions, which apply a condition to to a series of values to determine which to include in a total or and average, etc. do not accept AND or OR functions.


As with all blanket statements, it may be possible to fnd exceptions. :)



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.

Help with COUNTIF syntax pls

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