Count cells that contain numbers and ignore blank in Excel and Google Sheet

=COUNT(A2:A6)

=COUNT(A2:A6,"<>*")

A2:A6 = Ranges

Check below for a detailed explanation with pictures and how to use formulas in Excel and Google Sheets.