How to Use COUNTA Function in Excel (3 Methods)

Dataset Overview

The screenshot below provides an overview of this tutorial, demonstrating the application of the COUNTA function in Excel. We’ll use this dataset to illustrate the methods.

counta function overview in excel


Introduction to the COUNTA Function

counta function syntax

  • Function Objective:

The COUNTA function counts the number of cells in a range that are not empty.

  • Syntax:

=COUNTA(value1, [value2],…)

  • Arguments Explanation:
Argument Required/Optional Explanation.
value1 Required Any value or a range of cells.
[value2] Optional 2nd value or another range of cells.
  • Return Parameter:

Total count of non-empty cells as a numeric value.


Method 1 – Using COUNTA Function for a Single Range

Since the COUNTA function only considers non-empty cells, let’s explore how it works using the following chart with various data types (text values, number strings, error values, logical values, blank cells, wildcards, and spaces). All data lies in a single column (or range of cells).

  • Select the output cell B16 and enter:
=COUNTA(B5:B13)
  • Press Enter to find the total count of non-blank cells (result: 8).

counta function to count a single range of cells in excel

Note: Although there are 9 cells under the “List 1” header, cell B12 appears blank due to a space character, which prevents it from being counted as empty. COUNTA excludes cells where no single character is found.


Method 2 – Using COUNTA for Multiple Ranges

Consider the table with two columns of random data (highlighted for clarity).

To count non-empty cells from List 1 and List 2:

  • Select cell B16 and enter either of the following formulas:
=COUNTA(B5:C13)

Or,

=COUNTA(B5:B13, C5:C13)
  • Press Enter to get the total count (result: 16). The function excludes blank cells B8 and C9.

counta function for multiple range of cells in excel


Method 3 – Mixed Data Inputs in COUNTA Arguments

You can manually input different values or data types in COUNTA arguments, and they’ll be counted as non-empty.

  • In the output cell B16, enter:
=COUNTA(B5:B13,C5:C13,"Saimon","","TRUE",46)
  • Press Enter to get a count of 20 (including the additional random data).

counta function with mixed data input in excel


Difference between COUNT and COUNTA Functions

  • The COUNT function counts only numbers and excludes other values and empty strings.
  • The COUNTA function counts only non-empty cells.
  • See the example below (output cells B16 and B19).

difference between counta and count functions in excel

Read More: Difference Between COUNT and COUNTA Functions in Excel


Alternative to COUNTA: COUNTIF Function

  • The COUNTIF function allows you to define criteria for cell ranges, excluding empty cells during counting.
  • In output cell B16, use the formula:
=COUNTIF(B5:B13,"<>")
  • Press Enter to get a return value of 8.

alternative to counta function countif in excel


Things to Keep in Mind

1. Number of Arguments:

    • You can input up to 255 arguments in the COUNTA function.

2. Space Characters:

    • If the cell count seems confusing or incorrect, check whether any empty cells contain space characters.
    • The COUNTA function includes cells with space characters while counting.

3. Text Data and Double Quotes:

    • When inputting text data as an argument, use double quotes (” “) around the text string.

4. Combining COUNTA and COUNTBLANK:

    • To count a range of cells containing anything (non-empty) or nothing (blank), use both COUNTA() and COUNTBLANK() functions together.

5. Counting Numeric Values Only:

    • If you need to count cells containing numeric values only, use the COUNT function.

6. Counting Blank Cells Only:

    • For counting blank cells exclusively, use the COUNTBLANK function.

Download Practice Workbook

You can download the practice workbook from here:


Excel COUNTA Function: Knowledge Hub


<< Go Back to Excel Functions | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Nehad Ulfat
Nehad Ulfat

NEHAD ULFAT is an excellent marine engineer who loves working with Excel and diving into VBA programming. For him, programming is like a tool that saves time when dealing with data, files, and the internet. His skills go beyond the basics, including ABACUS, AutoCAD, Rhinoceros, Maxsurf, and Hydromax. He got his B.Sc in Naval Architecture & Marine Engineering from BUET but switched gears, working as a content developer.  In this role, he creates techy content all about Excel... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo