To count the number of cells that contain data using the COUNT function in Excel, follow these steps:
Select the cell where you want to display the count result.
Type the following formula: =COUNT(range)
Press Enter to get the count result.
The COUNT function will count all cells within the specified range that contain numeric or text values. It will not count cells with formulas, empty cells, or cells with only spaces or special characters.