Google Sheets COUNT and COUNTA functions with formula examples

The COUNT function in Google Sheets is one of the easiest to learn and extremely helpful to work with.

Even though it looks simple, it's capable of returning interesting and useful results, especially in combination with other Google functions. Let's get right into it.

What is COUNT and COUNTA in a Google spreadsheet?

The COUNT function in Google Sheets allows you to count the number of all cells with numbers within a specific data range. In other words, COUNT deals with numeric values or those that are stored as numbers in Google Sheets.

The syntax of Google Sheets COUNT and its arguments is as follows:

COUNT(value1, [value2,…])
  • Value1 (required) – stands for a value or a range to count within.
  • Value2, value3, etc. (optional) – additional values that are going to be covered as well.

What can be used as an argument? The value itself, cell reference, range of cells, named range.

What values can you count? Numbers, dates, formulas, logical expressions (TRUE/FALSE).

If you change the content of the cell that falls into the counting range, the formula will automatically recalculate the result.

If multiple cells contain the same value, COUNT in Google Sheets will return the number of all its appearances in those cells.

To be more precise, the function counts the number of times numeric values appear within the range rather than checks if any of the values are unique.

Tip. To count unique values in the range, use the COUNTUNIQUE function instead.

Google Sheets COUNTA works in a similar way. Its syntax is also analogous to COUNT:

COUNTA(value1, [value2,…])
  • Value (required) – the values we need to count.
  • Value2, value3, etc. (optional) – additional values to use in counting.

What's the difference between COUNT and COUNTA? In the values they process.

COUNTA can count:

  • Numbers
  • Dates
  • Formulas
  • Logical expressions
  • Errors, e.g. #DIV/0!
  • Textual data
  • Cells containing leading apostrophe (') even without any other data in them. This character is used at the beginning of the cell so that Google treats the string that follows as text.
  • Cells that look empty but in fact contain an empty string (=" ")

As you can see, the main difference between the functions lies in the ability of COUNTA to process those values that Google Sheets service stores as text. Both functions ignore completely empty cells.

Have a look at the example below to see how the results of using COUNT and COUNTA differ depending on the values:
COUNT and COUNTA in comparison

Since dates and time are stored and counted as numbers in Google Sheets, A4 and A5 were counted by both, COUNT and COUNTA.

A10 is completely empty, thus it was ignored by both functions.

Other cells were counted by the formula with COUNTA:


Both formulas with COUNT return the same result because A8:A12 range doesn't include numeric values.

A8 cell has a number stored as text which wasn't processed by Google Sheets COUNT.

The error message in A12 is entered as text and considered by COUNTA only.

Tip. To set more precise calculation conditions, I recommend you to use COUNTIF function instead.

How to use Google Sheets COUNT and COUNTA – examples included

Let's take a closer look at how the COUNT function is used in a Google spreadsheet and how it can benefit our work with tables.

Suppose we have a list of students' grades. Here are the ways COUNT can help:
Variations of COUNT for students' grades

As you can see, we have different formulas with COUNT in column C.

Since column A contains surnames, COUNT ignores that whole column. But what about cells B2, B6, B9, and B10? B2 has number formatted as text; B6 and B9 contain pure text; B10 is completely empty.

Another cell to bring your attention to is B7. It has the following formula in it:


Notice that the range starts from B2 and includes all other cells of this column. This is a very useful method when you often need to add new data to the column but want to avoid changing the range of the formula every time.

Now, how will Google Sheets COUNTA work with the same data?

COUNTA for students' grades

As you can see and compare, the results differ. This function ignores only one cell – the completely empty B10. Thus, bear in mind that COUNTA includes textual values as well as numeric.

Here's another example of using COUNT to find an average sum spent on products:

COUNT to find the average

The customers who haven't bought anything were omitted from the results.

One more peculiar thing regarding COUNT in Google Sheets concerns merged cells. There is a rule that COUNT and COUNTA follow to avoid double counting.

Note. The functions take into account only the leftmost cell of the merged range.

When the range for counting contains merged cells, they will be treated by both functions only if the upper-left cell falls within the range for counting.

For example, if we merge B6:C6 and B9:C9, the formula below will count 65, 55, 70, 55, 81, 88, 61, 92:


COUNT, COUNTA and merged cells

At the same time, the same formula with a slightly different range will work only with 80, 75, 69, 60, 50, 90:


The left parts of the merged cells are excluded from this range, therefore are not considered by COUNT.

COUNTA works in a similar way.

  1. =COUNTA(B2:B) counts the following: 65, 55, 70, 55, 81, 88, 61, "Failed", 92. Just like with COUNT, empty B10 is ignored.
  2. =COUNTA(C2:C) works with 80, 75, 69, 60, 50, 90. Empty C7 and C8, as in the case with COUNT, are ignored. C6 and C9 are omitted from the result since the range doesn't include the leftmost cells B6 and B9.

Count uniques in Google Sheets

If you'd rather count only unique values in the range, you'd better use the COUNTUNIQUE function. It requires literally one argument that can be repeated: a range or a value to process.

=COUNTUNIQUE(value1, [value2, ...])

The formulas in spreadsheets will look as plain as this:
Count unique records in Google Sheets.
You can also enter multiple ranges and even records themselves directly to the formula:
Scan multiple ranges/values for uniques.

Count with multiple criteria – COUNTIF in Google Sheets

In case the standard count is not enough and you need to count only specific values based on some conditions, there is another special function for that – COUNTIFS. All its arguments, the usage, and examples are covered in another special blog post.

I really hope that this article will assist your work with Google Sheets and that COUNT and COUNTA functions will serve you well.

You may also be interested in

Table of contents

27 responses to "Google Sheets COUNT and COUNTA functions with formula examples"

  1. Farul says:


    How do i calculate total days, if the date are given from and to? please help

  2. Rita Loja says:

    How do I calculate the over break instance in gsheet per headcount per month?
    Thank you

  3. William Kelshaw says:

    Can a counter be made in sheets to display the number of times a name appears on the spreadsheet

  4. JOHN says:


  5. Vince says:

    How to count the characters in one cell?

  6. Joel says:

    How do you count how many times a particular figure appears in the sheet or in a column/selected range?

  7. Jason says:

    I am hoping to get a count from a column. I want to be able to get a count of each different unit code in a column. So, not an overall count of the whole column but a count of each individual code in that column. I hope my question makes sense.

  8. Enitan says:

    Hi, How do i count number of unique values in a spreadsheet?
    How can I make sure the number is updated automatically when a new value is added to the spreadsheet?

  9. Karen says:

    We are trying to determine the best way to split our students into two groups, by counting the first letter of their last name in each of the homerooms and then seeing which has more a-k, a-l, a-m so we have an even amount on the alternating days they will come. All the students are in one workbook spread out by grade level on ten sheets so I would need to count the first letter of the last name on all sheets. I need two counts. One with all students and then one that removes the students who are only virtual (I have a separate column with this info). I'm working in Google sheets. Thank you!

  10. Richard DeStefanis says:

    How do I count the number of times all the numbers show up in the entire sheet? I have student ID numbers that are on the sheet based on a day. I have eight days of data so a student's name may be on there multiple days. How do I count the number of times a student's ID# is on the sheet? Each day has 300+ ID#s and there is 8 columns worth of days.

  11. Ilan says:

    How can I count the total number of sheets in a single Google spreadsheet?

  12. JM says:


    May I know what formula/count can I use in counting the number of positions in each department?

    For example in Google Spreadsheet,

    A is the department and B is the Position (e.g It Staff, It Manager, accounting manager) . At A, I have IT, Admin and accounting . At C, I manually counted 4 position relating to B -Admin.

    If you have any ideas what formula I can use for this problem rather than counting them one by one, I would appreciate it very much. Thanks!

    • JM says:

      At B, I manually counted 4 position relating to A -Admin for example.

      • Hi JM,

        You can use COUNTIFS to count different positions related to different departments.
        If this is not really what you need, describe the outcome you'd like to get in detail.

        • JM says:

          Hi Natalia I tried using COUNTIF, but I don't know which formula to use, the details I have is like this in a spreadsheet

          Column A - Employee Name
          Column B - Department - IT,It, IT, IT, It, Administration, Administration
          Column C- IT Assistant, IT Assistant, IT Associate, IT Manager, It Assistant, Admin Staff, Admin Staff, Admin Supervisor,

          This is the outcome I want using COUNTIF with more than 50 employees

          How many position in each department?
          IT Department - 3
          Administrative - 2

          I'll give another example

          Column A Fruit, Fruit, Fruit, Vegetable, Vegetable, Vegetable
          Column B, Apple, Apple, Strawberry, Lettuce, Cabbage, Onion

          Fruits - 2
          Vegetable - 3

          Hope this make sense. Thanks

Post a comment

Thank you for your comment! When posting a question, please be very clear and concise. This will help us provide a quick and relevant solution to your query. We cannot guarantee that we will answer every question, but we'll do our best :)