COUNTIF counts nonblank cells in Google Sheets when you use the <> criterion. Use it to count completed entries in a column of names, dates, numbers, or a mix of those values.
If the count is too high, check for spaces and review the range you've selected. For a different question, such as whether a cell contains a formula even when its result looks empty, choose COUNTA instead.
In this guide
Count the filled entries in one column
Put the total in a cell outside the data you're counting. Enter this formula, replacing the example range with your actual data column:
=COUNTIF(A2:A100,"<>")
Press Enter. Sheets returns one number in the formula cell. The range begins at row 2 here so a heading in A1 doesn't add another item to the total.

The <> criterion means not equal to the empty value in this formula. Keep it inside straight double quotes. The first part tells COUNTIF which cells to check; the second tells it which ones to count.
Google's COUNTIF reference explains the range and criterion arguments. A criterion is simply the rule each cell must meet before it adds one to the result.
A name adds one, a date adds one, and a number adds one. The function counts matching cells rather than adding their numbers together. For a column of payments, this gives the number of filled payment cells, not the money received.
Use a meaningful range. Counting the customer-name column tells you how many names are entered; counting an optional notes column tells you how many notes exist. Those totals can differ even when both formulas work correctly.
Choose what an empty-looking cell should mean
Three cells can look blank while holding different things: no content at all, a formula returning an empty string, or a space. Decide which ones should count before replacing a formula that appears to be wrong.
For cells with nonempty values, keep the COUNTIF formula. For cells that contain something, including a formula returning an empty string, use:
=COUNTA(A2:A100)
COUNTA includes text, repeated values, zero-length strings, and whitespace. That helps when you need to count cells containing formulas or other content. In a prefilled template, though, it can count rows that aren't finished.
For example, a template might have a formula in every row, with unfinished rows displaying nothing. Counting those formulas tells you how many cells contain something, rather than how many rows show an entry.
For row totals that should wait for an input, use IF to skip empty entries instead of counting the column.
Another clear way to count nonempty results in a single-column range is:
=ROWS(A2:A100)-COUNTBLANK(A2:A100)
This subtracts blank cells from the number of rows. The COUNTBLANK instructions treat both cells with no content and cells returning an empty string as blank.
Keep that ROWS version to one column. A range spanning several columns has more cells than rows, so subtracting its blank cells from ROWS gives an incorrect total.
I'd choose the simplest formula that matches the question. A completion total shouldn't need a complicated cleanup expression unless the source data actually contains the kind of hidden content that expression removes.
Check spaces when the total is too high
Even a single space gives a cell text content. Imported data and copied forms can leave spaces in cells that look unused, causing them to count as entries.
Check a suspicious entry's value in the formula bar. For a closer check, put =LEN(A2) in a spare cell, changing A2 to the cell you want to inspect. A result greater than zero means there are characters in its value.
Compare a few suspicious rows with genuinely empty rows. That helps you decide whether the total is counting unseen spaces or whether the selected range includes more records than you intended.
For a count that ignores ordinary spaces at the ends of text, use a helper column. Enter =LEN(TRIM(A2)) beside the first row, fill it through your data, then count helper values greater than zero with COUNTIF.
For example, if the helper values are in B2:B100:
=COUNTIF(B2:B100,">0")
Your original data stays as it is, and you can see what the formula counts in each row. A space-only result becomes zero; a name or other remaining text has a positive length.
TRIM isn't a universal cleaner for every invisible character, including nonbreaking spaces. If an imported row still counts unexpectedly, inspect that row rather than assuming all blank-looking content has been removed.
Keep the total outside its own counting range
An open-ended range such as A2:A can include future entries without editing the formula. Put the total in another column so it doesn't become part of the range it is counting.
A circular-dependency error can occur when the formula refers to itself. Move it outside the source range, or shorten the range to end before the total row.
Headers, footnotes, and old data also count if they sit inside the selected range. Check the colored range highlight when editing the formula; it should cover the records you mean to measure.
COUNTIF also counts matching cells in hidden or filtered-out rows. It doesn't become a visible-rows-only count just because a filter hides part of the sheet.
A nonblank count counts repeated names too. Use the Sheets duplicate-removal steps when repeated records are mistakes. Otherwise keep them and use a separate unique-count calculation.
Repair a formula that won't calculate
A formula must start with =. If the cell shows the expression as text, check whether it's formatted as plain text or has a leading apostrophe, then correct the format and enter the formula again.
Some spreadsheet locales use semicolons between arguments. When your sheet expects that separator, the same formula is:
=COUNTIF(A2:A100;"<>")
Keep the criterion's quotes straight and check that the closing parenthesis is present. Use the formula parse error guide when Sheets rejects the formula instead of returning an unexpected number.
If a manual count still differs, copy a few problem rows and inspect their contents. Share that sample in the Docs Editors help community and explain which cells you want to count. Leave personal records out.
The Short Version
COUNTIF counts nonempty values with the nonblank criterion. COUNTA includes empty-string formulas and spaces. Check the selected column and whitespace, and decide whether hidden rows should count.
For individual rows that must fail a condition, use Sheets NOT to reverse its TRUE or FALSE result.
Checked December 1, 2026.







