In Excel: use =COUNTA(range) — it counts every cell that is not empty, whatever it contains, which makes it the function for sizing a list.
Syntax
Arguments
| Argument | Description | |
|---|---|---|
value1 | required | The first range or value. Every non-empty cell is counted. |
value2, ... | optional | Further ranges or values. |
Related functions
Operators >, >=, <, <=, <> and the * / ? wildcards all work, exactly as in Excel. Matching is case-insensitive.
- Not blank (COUNTA)
- 6
- Numbers (COUNT)
- 3
- Text cells
- 3
- Blank (COUNTBLANK)
- 2
8 cells read
COUNT only counts numbers; COUNTA counts anything that is not blank. A number stored as text is text to both.
What this does
COUNTA counts non-empty cells regardless of content: numbers, text, dates, logicals and error values all count. The one thing to watch is that a formula returning an empty string is not actually empty — the cell contains a formula, so COUNTA counts it. That is why a column of =IF(A2="", "", …) formulas reports a full count even though it looks blank. Where the goal is genuinely visible entries, COUNTIF with "<>" or a SUMPRODUCT test on the length is more honest. The same idea underpins a lot of everyday Excel work, so the few minutes spent getting it right here pay back across every sheet you build afterwards. Treat it as a pattern, not a one-off, and it stops being something you look up and starts being something you reach for. For “excel counta if”, the reliable version is a short checking loop, not just the first command that appears to work. Run it on a deliberately small range first, watch how the affected cells change, and only then apply the same setup to the full sheet. When a formula is involved, keep the inputs labelled beside it, reference cells instead of typing values, and apply number formatting only after the result checks out. That is what makes a workflow that saves repeating the same clicks every week useful in real work: repeatable, auditable, and not dependent on memory or luck.
A worked example
A name column A2:A500 with gaps: =COUNTA(A2:A500) returns how many rows actually have a name, which is the list size. If column B holds =IF(A2="","",A2) formulas, =COUNTA(B2:B500) returns 499 regardless — use =COUNTIF(B2:B500,"<>") minus the empty-string count, or =SUMPRODUCT(--(LEN(B2:B500)>0)), to count only the visible entries. COUNTA is how you measure the real size of a list, provided you know it counts formula-produced blanks too. A practical tip before you scale it up: build it once on a small block of test data, confirm the number against the tool on this page, and only then point it at your real sheet. That one habit catches almost every mistake while it is still cheap to fix, long before a wrong figure reaches a report or a colleague.
In Google Sheets
Everything above works in Google Sheets too. Excel and Sheets share the formula syntax used here; only the surrounding menus are arranged differently. That portability is deliberate — learn it once and it follows you between the two tools and across Windows and Mac. The aim was to get you unstuck fast and leave you a little more capable than a copy-paste would. The answer is at the top, the tool proves it, and the detail above shows why it holds — so the next time a colleague asks, you can answer without reaching for search. If you take one thing from this page on “excel counta if”, make it the habit rather than the keystrokes: set the problem up with labelled inputs, reference those cells, and let Excel do the recomputing. Bookmark the page for the syntax, but do the example once in a blank sheet and check it against the tool above — five minutes of hands-on practice fixes the method in memory far better than re-reading, and it surfaces the small snags while they are still harmless. After that the technique is genuinely yours: faster than searching for it again, and reliable enough to drop into work that other people depend on.
Common mistakes
- Counting a column of formulas that return "" and reading the result as the number of filled rows.
- Using
COUNTAwhere only numbers should count, which silently includes text placeholders. - Assuming it ignores errors — an
#N/Acell is non-empty and counts.
Frequently asked questions
Does COUNTA count formulas that return an empty string?
Yes. The cell is not empty, it contains a formula, so it counts. That is the most common surprise with this function.
How do I count only visible entries?
Use =SUMPRODUCT(--(LEN(range)>0)), which tests the actual text length rather than cell occupancy.
What is the difference between COUNTA and COUNT?
COUNTA counts everything non-empty; COUNT counts only numeric values.