totn Excel Functions

MS Excel: How to use the COUNTA Function (WS)

This Excel tutorial explains how to use the Excel COUNTA function with syntax and examples.

Description

The Microsoft Excel COUNTA function counts the number of cells that are not empty as well as the number of value arguments provided. See the NOTE section below for more information.

The COUNTA function is a built-in function in Excel that is categorized as a Statistical Function. It can be used as a worksheet function (WS) in Excel. As a worksheet function, the COUNTA function can be entered as part of a formula in a cell of a worksheet.

subscribe button Subscribe

If you want to follow along with this tutorial, download the example spreadsheet.

Download Example

Syntax

The syntax for the COUNTA function in Microsoft Excel is:

COUNTA( argument1, [argument2, ... argument_n] )

Parameters or Arguments

argument1, argument2, ... argument_n
Each argument can be a range, a cell or a value. There can be up to 255 arguments.

Returns

The COUNTA function returns a numeric value.

Note

  • If the argument is a range, each cell in the range that is not empty will be counted as 1.
  • If the argument is a cell and the cell is not empty, it will be counted as 1.
  • If the argument is a value and not a range or cell, it will be counted as 1.

Applies To

  • Excel for Office 365, Excel 2019, Excel 2016, Excel 2013, Excel 2011 for Mac, Excel 2010, Excel 2007, Excel 2003, Excel XP, Excel 2000

Type of Function

  • Worksheet function (WS)

Example (as Worksheet Function)

Let's look at some Excel COUNTA function examples and explore how to use the COUNTA function as a worksheet function in Microsoft Excel:

Microsoft Excel

Based on the Excel spreadsheet above, the following COUNTA examples would return:

=COUNTA(C2:C7)
Result: 3    'Number of students with a grade in Math

=COUNTA(D2:D7)
Result: 2    'Number of students with a grade in Biology

=COUNTA(E2:E7)
Result: 4    'Number of students with a grade in Chemistry

Combining Range and Value Arguments

The COUNTA function not only counts cells that are not empty, but it also counts the number of value arguments provided. A value argument is a parameter that is not a cell or range of cells.

For example, let's assume that the spreadsheet was missing two students named Jason and Chris and these students were also taking the Math class.

We could modify the formula that counts the number of students taking Math to include Jason and Chris as follows:

=COUNTA(C2:C7,"Jason","Chris")
Result: 5    'Number of students with a grade in Math + Jason + Chris

This formula would count the number of cells that are not empty in the range C2:C7. Then it would add 2 more because of the 2 value arguments "Jason" and "Chris". This makes a total count of 5.