Count cells in a column or row by using

Count cells, rows, or columns of data

Count cells in a column or row by using a built-in command

Use the Count Numbers feature of the AutoSum command by selecting a range of cells that contains at least one numeric value and then, on the Home tab, in the Editing group, click the arrow next to AutoSum. Then click Count Numbers. Excel returns the count of the numeric values in the range in a cell adjacent to the range you selected. Generally, this result is displayed in a cell to the right for a horizontal range or in a cell below for a vertical range.

Count cells, rows, or columns of data

Sample value
5
32
hello
10
=COUNT(A2:A5)