MacOS – How to reference a cell from within a “…IF”-type function condition string

macosnumbers

When using a ...IF type of function (like COUNTIF, AVERAGEIF, etc.), I use condition strings:

  • e.g. ">100", "=Mr. Smith"

Instead of using a literal from within the string, how do I (or can I) reference a different cell from within the table?

  • e.g. ">ColA Row2"

Stuff I've Tried (that doesn't work)

...,"=A2",...
...,=A2,...

Best Answer

When directly referencing a cell from within an IF type function, don't use a condition string. Also, no need to use a comparison operator.

  • Condition string usage, to compare against a literal value:

    COUNTIF(A1:A20, "=Mr. Smith")

  • Direct cell reference, to compare against cell B1:

    COUNTIF(A1:A20, B1)