COUNTA will count both numbers and text.

If C5 is not blank, return the count, otherwise return an empty string.

This version uses the not equal tooperator(<>).

Excel formula: Automatic row numbers

COUNTA does not count empty cells.

More than one condition can be tested by nesting IF functions.

For example, if A1 contains “apple”, ISBLANK(A1) returns FALSE.

Excel formula: Automatic row numbers in Table

Excel formula: Last n rows

Excel formula: Get relative row numbers in range

Excel formula: First row number in range

Excel formula: Last row number in range

Excel formula: First column number in range

Excel formula: Basic outline numbering

Excel COUNTA function

Excel IF function

Excel ISBLANK function