I want to get a formula with COUNTIFS
, like
=COUNTIF(A1:A3,"<>"&"")
such that when A1
= 2, A2
= "", A3
= empty, it returns 1.
Notes:
A2
contains an empty string, as the result of a formula. A3
is a blank cell, with no formulas in it.&CHAR(34)&CHAR(34)
. I get 2.=COUNTIFS(range1,cond1,range2,cond2)
, that is why I cannot use something like
=ROWS(A1:A3)-COUNTIF(A1:A3,"")
or =ROWS(A1:A3)-COUNTBLANK(A1:A3)
(see this).
range1
and range2
would come from expressions with INDIRECT
, but that is probably not relevant.=SUMPRODUCT(--(expression1),--(ISNUMBER(A1:A3)))
, but I am specifically asking about the possibility of using COUNTIFS
. Discrimination of number vs. text (e.g.) is not relevant at this point.ISBLANK(A2)
returns FALSE
, but COUNTBLANK(A2)
returns 1
.Function
.Use a SUMPRODUCT function that counts the SIGN function of the LEN function of the cell contents.
As per your sample data, A1 has a value, A2 is a zero length string returned by a formula and A3 is truly blank.
The formula in C2 is,
=SUMPRODUCT(SIGN(LEN(A1:A3)))