Excel Countif Not equal to string length of zero

user2242044 picture user2242044 · May 16, 2014 · Viewed 17.6k times · Source

I have a formula an iferror formula that puts in "" if an error occurs. This is a zero length string. I'd like to do a count if not equal to "".

=countif(A:A,<>"") 'is not a valid formulas
=countif(A:A,"<>") 'checks for actual blanks, not zero length strings

Answer

Jonathan Gawrych picture Jonathan Gawrych · Apr 3, 2016

Rather than using COUNTBLANK and subtracting from the total, you can use:

=COUNTIF(A:A,"?*")

? is the single character wildcard.
* is the multiple character wildcard.
Combining these two, it will count if there are 1 or more characters.

Note that this works only if the cells contains strings, not numbers.