The COUNTA function's job is to count the number of cells in a selected range that contain data such as numbers, dates, formulas, or text labels.
It ignores empty cells. If data is later added to an empty cell the function will be automatically updated to include the addition.
The syntax for the COUNTA function is:
= COUNTA ( Value1, Value2, ... Value255 )
Up to 255 values can be entered into the function.
Example: Counting cells containing data with COUNTA
For help with this example, see the image above.
- Enter the following data into cells D1 to D4: A , 25 , 4/4/2010 , D .
- Enter the following data into cell D6 (we have deliberately left cell D5 blank): 34 .
- Click on cell D7 - the location where the results will be displayed.
- Click on the Formulas tab.
- Choose More Functions > Statistical from the ribbon to open the function drop down list.
- Click on COUNTA in the list to bring up the function's dialog box.
- Drag select cells D1 to D6 on the spreadsheet to enter the range into the dialog box.
- Click OK.
- The answer 5 should appear in cell D7 because only five of the six cells in the range contain data - cell D5 is empty.
- When you click on cell D7 the complete function = COUNTA ( D1 : D6 ) appears in the formula bar above the worksheet.
Note: If you late add data to cell D5 the total in cell D7 changes to 6 because now all six cells in the range D1 to D6 contain data.