The syntax for the COUNT function is:
= COUNT ( value_1 , value_2 , ... value_30 )
If cell references are used, the COUNT function ignores empty cells or text data in cells in the selected range.
If number data is later added to an empty cell in the range, the count total is automatically updated.
Example Using the Google Spreadsheet COUNT Function:
- Enter the following data into cells A1 to A5: 114, 165, 178, 143, 130.
- In cell A6 type the word test
- Leave cell A7 blank.
- Click on cell A8 - the location for the function and where the results will be displayed.
- Click on Insert > Formula > COUNT in the menus.
- Google Spreadsheets inserts the first part of the function = COUNT ( into cell A8.
- Drag select cells A1 to A7 with the mouse pointer to enter that range into the function.
- Type the closing bracket " ) " after the cell range in cell A8.
- Press the ENTER key on the keyboard.
- The answer 5 appears in cell A8 because only five cells in the range A1 to A7 contain numbers. Cells A6 and A7 are ignored.
- Type the number 180, in cell A7 and press the ENTER key on the keyboard.
- The function total in cell A8 should change from 5 to 6 since now six cells in the range contain numbers.
- When you click on cell A7 the complete function = COUNT ( A1 : A7 ) appears in the formula bar above the worksheet. .