Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Or you can use the formula =COUNTIF(LEN(A1:A2);">0"), entered as array formula using Ctrl-Shift-Enter. It will count texts too, but neither empty cells nor empty strings nor errors. Or =COUNTIF(LEN(A1:A2);"<>0"), which will count errors in addition.

Or you can use the formula =COUNTIF(LEN(A1:A2);">0"), entered as array formula using Ctrl-Shift-Enter. It will count texts too, but neither empty cells nor empty strings nor errors. Or =COUNTIF(LEN(A1:A2);"<>0"), which will count errors in addition.

test cases

Or you can use the formula =COUNTIF(LEN(A1:A2);">0"), entered as array formula using Ctrl-Shift-Enter. It will count texts too, but neither empty cells nor empty strings nor errors. Or =COUNTIF(LEN(A1:A2);"<>0"), which will count errors in addition.

test cases

Update: There are two solutions, which seem to work the same in different versions of LibreOffice and Apache OpenOffice. The first one =COUNTIF(A1:A2;".+") needs regular expression, see Davids answer for details. The second one {=SUM(A1:A2<>"")} is an array-formula. Enter it without the curly brackets and finish with Ctrl+Shift+Enter.

new test cases including these formulas