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
```

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.

Tags: excelexcel, text