Home » excel » how can I count number of rows that contains text/numbers in excel

how can I count number of rows that contains text/numbers in excel

Posted by: admin May 14, 2020 Leave a comment

Questions:

I want to count all rows in a range that contains either text or numbers, what formula can I use for that? I tried this but it does not count correct…

=COUNTIF(B2:B50;"*") + SUMPRODUCT( -- ISTEXT(B2:B50))

data/text in cells can be like this…

    S
    160
    XS
    M
How to&Answers:

To count both text and numbers, use COUNTA > =COUNTA(B2:B50)

Be aware that this does also count empty formulas!

Answer:

To make your original formulas work.

You can use

=COUNTIF(B2:B50,"<>")

or

=SUMPRODUCT(--(B2:B50<>""))

However, @JvdV formula is more appropriate. If you need to ignore formula blanks then the SUMPRODUCT formula can be used.