To count numeric cells in an Excel range, use =COUNT(A2:A20) when your values are in A2:A20. COUNT includes numbers, dates, and times, but ignores text and blank cells; use COUNTA instead if you want to count all nonempty cells.
What COUNT Does in Excel
COUNT is Excel’s basic function for finding how many cells in a selection contain numeric values. It returns a number, not a list of the cells it counted. This makes it useful for checking how many records have a numeric entry, how many measurements were collected, or how many dates appear in a column.
Excel stores dates and times as numbers, so COUNT includes them. For example, a cell formatted to display 15 March 2026 still contains a serial number behind the scenes. A percentage such as 25% is also numeric and is counted. A numeric zero counts too: a cell containing 0 is not treated as blank.
COUNT does not count ordinary text, empty cells, or text that merely looks like a number. It also does not count TRUE or FALSE when those values are in referenced cells. Error values are not counted as numeric entries. These distinctions explain why the result may be lower than the number of cells that look filled on screen.
COUNT Syntax and Range References
The function name is followed by one or more arguments, usually a cell range. The colon means “through,” so A2:A20 includes every cell from A2 down to A20. You can select the range with the mouse while entering the formula, or type its address directly.
With values in A2:A20, this formula counts the numeric entries in that column segment: =COUNT(A2:A20). COUNT also accepts more than one range. With the first set of values in A2:A10 and a second set in C2:C10, =COUNT(A2:A10,C2:C10) counts the numbers in both ranges together. The ranges do not need to be adjacent.
To enter a formula, select the cell where you want the result, type an equals sign and the function, then press Enter. In Microsoft 365 for Windows, you can also select the range with the mouse after typing the opening parenthesis. On Mac, the formula syntax is the same; the main difference is that keyboard shortcuts and some ribbon details may differ. Excel for the web also supports COUNT with the same formula syntax.
A Worked Example: Numbers, Text, and Blanks
Suppose A2:A8 contains 12, a blank cell, the text N/A, 0, a date, 7, and TRUE—in that order. With those entries in A2:A8, =COUNT(A2:A8) returns 4. The counted cells are 12, 0, the date, and 7. The blank, text entry, and TRUE value are excluded.
This example also shows why counting visible entries by eye can be misleading. The N/A text and TRUE value are present, but they are not numeric values. If a value was imported as text—for example, the characters “12” stored as text—COUNT will ignore it even though it looks like a number. Changing the cell’s number format alone does not convert text into a number. You may need to correct the source data or convert the text value.
When troubleshooting, select a suspicious cell and check the formula bar and alignment or inspect its value with Excel’s data tools. A leading apostrophe is one common reason a number is stored as text. Imported data can also contain spaces or other characters that prevent conversion.
COUNT Compared with COUNTA and COUNTBLANK
Choose the counting function according to what qualifies as an entry. COUNT is for numeric values. COUNTA counts cells that are not empty, including text, numbers, logical values, and errors. COUNTBLANK counts empty cells and also cells containing formulas that return an empty text string. As a result, a cell that looks blank may still be handled differently by different functions.
- COUNT: counts numeric values, including dates, times, percentages, and zero.
- COUNTA: counts cells containing any value or formula, including text and errors.
- COUNTBLANK: counts blank cells, including formula results that display as empty text.
For example, if B2:B10 contains six filled cells and three genuinely empty cells, and one of the filled cells is a formula returning an empty string, the visual appearance alone may not tell you how each function will count the range. With B2:B10 as that example range, =COUNTBLANK(B2:B10) returns 4: the three empty cells plus the formula cell that returns an empty string. COUNTA, by contrast, counts that formula cell because a formula is present.
Count Cells That Meet a Condition
COUNT gives a total for numeric entries without applying a test. To count values that meet one condition, use COUNTIF. The first argument is the range to examine and the second is the criterion. Put comparison operators and numbers together inside quotation marks in the criterion.
Suppose B2:B10 contains test scores 62, 70, 71, 84, 90, 68, 75, 100, and one blank. With those scores in B2:B10, =COUNTIF(B2:B10,">70") returns 5, counting 71, 84, 90, 75, and 100. The score 70 is not included because the condition is greater than 70, not greater than or equal to 70.
COUNTIF can also count a matching word or an exact number. For example, it can count cells equal to the text East or cells equal to 0. Excel supports wildcard characters in text criteria: an asterisk represents any number of characters, and a question mark represents one character. Wildcards are useful for partial text matches, but they do not turn COUNTIF into a general search across every part of a cell’s contents.
For two or more conditions that must all be true, use COUNTIFS. Suppose A2:A8 contains department names and B2:B8 contains scores. If the rows are Sales/82, Sales/69, Support/91, Sales/76, Support/88, Sales/95, and Support/72, then with departments in A2:A8 and scores in B2:B8, =COUNTIFS(A2:A8,"Sales",B2:B8,">=75") returns 3. It counts Sales rows with a score of at least 75. Each criteria range in COUNTIFS must cover the same number of rows or columns as the others.
Counting Visible Rows in a Filtered List
COUNT includes numbers in rows hidden by a filter, so it may not match the number of visible records. If you need a count that responds to filtering, use SUBTOTAL with function number 2 for COUNT. To exclude rows hidden manually as well as rows removed by a filter, use function number 102.
For example, assume D2:D6 contains five numbers: 10, 20, 30, 40, and 50. If the row containing 20 is manually hidden and the row containing 40 is filtered out, then with these values in D2:D6, =SUBTOTAL(102,D2:D6) returns 3, counting the visible numeric values 10, 30, and 50. By comparison, =COUNT(D2:D6) returns 5 because COUNT does not omit hidden rows.
SUBTOTAL is useful for filtered lists, but it is not a replacement for COUNT in every situation. Its result changes when rows are hidden or shown, which is precisely what makes it helpful for a visible-record total and unsuitable when you want an unchanging count of the entire range.
Common Counting Problems and Checks
If COUNT returns zero when you expect a positive result, first check whether the apparent numbers are stored as text. Also confirm that the formula refers to the intended cells and that the range includes the last row of data. A range such as A2:A20 will not include a value accidentally entered in A21.
If the result is one too low, look for a blank or text value among the expected numbers. A formula that displays a number can usually be counted if its result is numeric, but a formula returning text is not counted by COUNT. A formula returning an empty string is not a numeric result. Similarly, an error in a cell does not add to COUNT’s total.
Another frequent misunderstanding is assuming that formatting determines the underlying value. Currency, date, percentage, and decimal formats change how a value appears; they do not change whether it is numeric. Conversely, applying a number format to text does not necessarily convert the text into a numeric value. When accuracy matters, verify a few cells rather than relying only on their displayed appearance.
Choosing the Right Counting Method
Start by deciding what “count” means for your task. If you want the number of numeric measurements or dates, COUNT is the direct choice. If every populated cell should count regardless of whether it contains text or a number, use COUNTA. If you need blanks, use COUNTBLANK. For a condition such as a score above a threshold, COUNTIF is more appropriate; for several simultaneous conditions, choose COUNTIFS.
For a filtered report, use SUBTOTAL when the answer should update to reflect visible rows. Before sharing a workbook, consider documenting the intended rule in a nearby label, such as “Numeric scores” or “Visible records.” That small explanation helps another reader understand why a count may differ from the number of filled cells or from a total calculated elsewhere.
These functions are built into current Microsoft 365 Excel for Windows, Mac, and the web. They do not require an add-in or a special data type. Formula separators can vary with regional settings: the examples here use commas, as required by the usual English-language Excel syntax, but some installations use semicolons between arguments.
Frequently Asked Questions
Does COUNT include zero in Excel?
Yes. Zero is a numeric value, so COUNT includes a cell containing 0. A genuinely empty cell is not counted.
Does COUNT count dates and times?
Yes. Excel stores dates and times as numbers, so COUNT includes them when they are in the referenced range. Their date or time formatting does not change that.
Why does COUNT ignore numbers that look like numbers?
They may be stored as text rather than numeric values. Formatting the cells as Number may not convert them; check the source and convert the text values if appropriate.
How do I count all nonblank cells instead of only numbers?
Use COUNTA on the range. It counts text and other populated cells as well as numbers, including cells containing formulas.
How do I count only visible cells after filtering?
Use SUBTOTAL with function number 102 and the range. It counts visible numeric cells and excludes rows hidden by filters or hidden manually.
Related
- Monthly Excel Budget Format: Build a Simple Template
- Year Calendar in Excel: Create a 12-Month View
- When Was Excel Created? The 1985 Launch Explained
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Basic Conditional Formatting in Excel: A Practical GuideIn Excel, select the cells you want to format, then choose Home > Conditional Formatting and pick a…
- How to Insert a Row in Excel After Any Specific RowTo insert a blank row after a specific row in Excel, select the row number directly below it,…
- Excel Attendance Format: A Clear Monthly Attendance TrackerAn Excel attendance format is a spreadsheet that lists each person in a row and each date in…
- Excel Text to Columns: Can You Make It Automatic?No—not for every kind of pasted text. In Excel for Microsoft 365 on Windows, tabs in copied text…
- Record Data in Excel Online: Setup, Sharing and TipsYes. You can record and manage data in Excel for the web by creating a workbook in OneDrive…
- Add a Watermark to Just the First Page in WordTo add a watermark to just the first page in Word, separate page one from the rest of…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.