Count Cells With Content in Excel

How-to basics · Updated December 3, 2026

To count cells with content in Excel for Microsoft 365 on Windows, use =COUNTA(A1:A10), replacing the example range with the cells you want to check. COUNTA counts cells that are not empty, including cells containing text, numbers, dates, logical values, errors, or formulas—even formulas that display an empty string.

What “cells with content” means

In Excel, “count cells with content” usually means count cells that are not blank. The built-in function for this is COUNTA. It is useful for checking how many entries are present in a list, how many records have been entered, or how much of a worksheet range is populated.

A cell’s appearance can be misleading. A cell may look empty because its font color matches the background, its contents are hidden by formatting, or a formula returns an empty string. COUNTA evaluates whether the cell contains something, not whether you can see characters in it. Conversely, a cell that has only formatting applied, with no value or formula, is treated as empty by COUNTA.

For example, if A1 contains “North,” A2 contains the number 42, A3 is genuinely blank, and A4 contains a formula returning an empty string, =COUNTA(A1:A4) returns 3. A1, A2, and A4 contain entries from Excel’s perspective; A3 does not.

Count nonblank cells with COUNTA

Enter COUNTA in an empty cell, then provide the range to count. The range can be a row, column, or rectangular block. For example, if names are in B2:B50, use =COUNTA(B2:B50). If the range contains 37 nonblank cells, the result is 37.

For multiple separate ranges, separate the range arguments with commas. If you have entries in A2:A10 and C2:C10, use =COUNTA(A2:A10,C2:C10). Do not include the same cells twice in the arguments, or they will be counted more than once.

You can also select a range and check Excel’s status bar at the bottom of the window. When the selection contains data, the status bar may display Count. If it does not, right-click the status bar and select Count. This is a quick inspection, while a formula is better when you need a result that updates in a worksheet.

Choose the right counting function

COUNTA is not always the right choice. Pick a function based on what you mean by “content”:

  • COUNTA: Counts cells that are not empty, including text, numbers, errors, and formulas that return an empty string.
  • COUNT: Counts cells containing numeric values. It also counts dates and times because Excel stores them as numbers, but it does not count text or error values.
  • COUNTBLANK: Counts blank cells. It also treats a formula that returns an empty string as blank for this function.
  • COUNTIF: Counts cells matching a condition, such as a particular word or a value greater than a threshold.

For instance, if A2:A6 contains 12, “Pending,” a blank cell, a formula returning an empty string, and 0, COUNTA returns 4. COUNT returns 2 because 12 and 0 are numeric. COUNTBLANK returns 2: the genuinely empty cell and the formula result that appears blank. Zero is content, not a blank.

Count entries that meet a condition

When you want to count only certain entries, use COUNTIF for one condition. With status labels in C2:C100, use =COUNTIF(C2:C100,"Complete") to count cells equal to Complete. The text criterion is in quotation marks. COUNTIF can also handle comparisons, such as =COUNTIF(B2:B100,">0") to count positive numbers in that range.

For several conditions, use COUNTIFS. With department names in A2:A100 and status labels in B2:B100, =COUNTIFS(A2:A100,"Sales",B2:B100,"Complete") counts rows where the department is Sales and the status is Complete. Each criteria range must have the same dimensions as the others.

These functions count matching cells or records; they do not replace COUNTA when the goal is simply to count all populated cells. Be clear about whether you are counting nonblank entries, numeric values, or entries satisfying a rule.

Common surprises and troubleshooting

A frequent surprise is that COUNTA includes formulas whose displayed result is blank. For example, a formula such as =IF(A2="","",A2) still occupies its cell. If your goal is to count visible, nonempty text results while excluding formula-generated empty strings, use a condition that excludes empty strings. With results in A2:A100, =COUNTIF(A2:A100,"<>") counts cells whose result is not blank, including numbers and text, while excluding cells that evaluate to an empty string. Check the result against your data if errors or unusual values are present.

Other common issues include:

  • Spaces mistaken for blanks: A cell containing one or more spaces is not empty, so COUNTA counts it. Remove unwanted spaces or clean the source data if those cells should be blank.
  • Hidden rows: COUNTA includes entries in hidden or filtered-out rows. It counts the specified range, not just the visible records.
  • Unexpected range: Check that the formula covers the intended cells and does not omit new rows or include headers that should not count.
  • Numbers stored as text: COUNTA counts them because they are content, but COUNT may not treat text-formatted numbers as numeric values.

If a result seems wrong, click a cell that looks empty and inspect the formula bar. A formula, space, or hidden character may explain why it is counted. To remove unwanted spaces from text, Excel’s TRIM function can help, although it does not remove every kind of nonprinting character.

Count only visible cells

COUNTA does not automatically ignore rows hidden by a filter. If you need a count that changes to reflect filtered or manually hidden rows, use SUBTOTAL rather than COUNTA. With entries in A2:A100, =SUBTOTAL(103,A2:A100) counts nonblank visible cells and excludes filtered-out rows. The 103 option also ignores manually hidden rows. The result is useful for filtered lists, but it can differ from COUNTA because hidden entries are excluded.

For a table, structured references can make formulas easier to maintain. If a table is named Table1 and the column is named Status, =COUNTA(Table1[Status]) counts nonblank cells in that table column and typically adjusts as rows are added. Use the actual table and column names from your workbook.

Frequently Asked Questions

Does COUNTA count cells containing zero?
Yes. Zero is a numeric value, so COUNTA counts it. COUNT also counts zero because it is numeric.

Does COUNTA count formulas that show nothing?
Yes. A cell containing a formula is not empty, even when the formula returns an empty string and the cell appears blank. COUNTBLANK, by contrast, treats a formula result of an empty string as blank.

How do I count truly empty cells?
Use =COUNTBLANK(A1:A10), changing the range as needed. COUNTBLANK includes genuinely empty cells and cells whose formulas return an empty string.

Does COUNTA count filtered-out rows?
Yes. It counts nonblank cells throughout its range, including rows hidden by filtering. Use =SUBTOTAL(103,A1:A10) when you want a count of visible nonblank cells instead.

Can I count nonblank cells in more than one range?
Yes. Provide multiple ranges as arguments, such as =COUNTA(A1:A10,C1:C10). Make sure the ranges do not overlap unless you intentionally want overlapping cells counted twice.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.