I am trying to count non-blank cells in a column, here is what I do
COUNTIF(D:D,NOT(ISBLANK(D:D)))
It doesn't work and always returns "0".
I am aware there are other better ways like COUNTA
and =countif(D:D,"<>")
, but for learning purpose, I am wondering how I can do this with isblank
. I think the problem here is countif
is running on a range while isblank
is running on a cell. However, this works and it puzzles me:
FILTER(D:D,NOT(ISBLANK(D:D)))
There seems to be a type of function that is designated to be working on arrays. I think it plays a role in this situation. On Google sheet's document page like https://support.google.com/docs/answer/3093197?hl=en it doesn't mention whether a function is "Array function" or not, so how do I know when I can put functions like isblank
in a parameter of another function and it would loop through the range defined by its own parameter? In other words, why isblank
is able to loop through D:D
when it is in FILTER
function but not in COUNTIF
? What is the difference between FILTER
and COUNTIF
here and where is the document referencing this difference? Is there any other function like FILTER
that would work with functions like isblank
?