The COUNT function in Google Sheets counts the number of cells in a range that contain numbers. The basic syntax is =COUNT(value1, [value2, ...]), where value1 is the first range or cell reference. For example, =COUNT(A1:A10) returns how many cells in A1:A10 contain numeric values.
What Exactly Does COUNT Count?
COUNT is designed to tally cells that contain numbers, including dates and times (since those are stored as numbers in Sheets). It ignores empty cells, text, logical values (TRUE/FALSE), and error values. This makes it ideal for counting entries in a column of numeric data, like sales figures or test scores.
Key behaviors to remember:
- Numbers formatted as text (e.g., a cell with an apostrophe before the number) are not counted.
- Dates and times count because they are numeric values.
- Cells with formulas that return numbers are counted.
- Blank cells and cells with spaces are ignored.
How to Use COUNT in Google Sheets
Using COUNT is straightforward. Click a cell where you want the result, type =COUNT(, then select a range or type it manually, and press Enter. For example, if you have numbers in B2:B20, enter =COUNT(B2:B20).
You can also count across multiple ranges: =COUNT(A1:A10, C1:C10). This adds the counts from both ranges. If you need to count cells that meet a condition, use COUNTIF or COUNTIFS instead.
COUNT vs. COUNTA vs. COUNTBLANK
Google Sheets offers several counting functions, each with a distinct purpose:
- COUNT – counts numeric cells only.
- COUNTA – counts all non-empty cells, including text, numbers, and errors. Use it to count entries in a list of names.
- COUNTBLANK – counts empty cells in a range.
- COUNTIF – counts cells that meet a single condition, e.g.,
=COUNTIF(A1:A10, "Yes"). - COUNTIFS – counts cells that meet multiple conditions across multiple ranges.
For example, if column A has a mix of numbers and text, =COUNT(A1:A10) might return 4, while =COUNTA(A1:A10) might return 8.
COUNT in Excel vs. Google Sheets
The COUNT function works nearly identically in Microsoft Excel and Google Sheets. The syntax is the same, and both ignore text and logical values. The main differences are minor: in Excel, you might use =COUNT(A1:A10) in the same way, but Excel also has a COUNT function in its function library. In Google Sheets, you can also use the COUNT function with the same syntax. One notable difference: Excel’s COUNT can handle up to 255 arguments, while Google Sheets also supports multiple arguments but with no practical limit for typical use.
Common Errors and How to Fix Them
If your COUNT formula returns an unexpected result, check these common issues:
- Counting text numbers: If cells look like numbers but are left-aligned, they may be text. Use
=VALUE(A1)to convert, or re-enter as numbers. - Including headers: If you accidentally include a header row with text, COUNT ignores it, but if the header is a number (like a year), it will be counted. Adjust your range to exclude it.
- Errors in the range: COUNT ignores error values, so a cell with
#DIV/0!won’t be counted. If you need to count errors, use=SUMPRODUCT(--ISERROR(range)). - Using COUNT on a filtered list: COUNT counts all cells in the range, including hidden rows. To count only visible filtered cells, use
=SUBTOTAL(2, range)or=SUBTOTAL(102, range).
Practical Examples of COUNT
Let’s look at a few real-world uses:
- Counting survey responses: If you have a column of numeric ratings (1-5) in C2:C100,
=COUNT(C2:C100)tells you how many people gave a numeric rating, ignoring blanks. - Counting items in stock: With product quantities in D2:D50,
=COUNT(D2:D50)gives the number of products that have a quantity entered. - Counting dates: If you have a list of order dates in E2:E30,
=COUNT(E2:E30)counts how many orders have dates, since dates are numbers.
For a more complex example, to count cells in A1:A10 that are greater than 5, use =COUNTIF(A1:A10, ">5"). To count cells that are not blank and contain a number, you can use =COUNT(A1:A10) directly.
Frequently Asked Questions
Does COUNT count cells with formulas? Yes, if the formula returns a number, COUNT includes it. If the formula returns text or an error, it is ignored.
Why does COUNT return 0 when I have numbers in the range? This usually happens when the numbers are stored as text. Select the cells, look for a warning icon, and choose “Convert to number”.
Can I use COUNT with multiple ranges? Yes, you can list multiple ranges separated by commas, like =COUNT(A1:A5, C1:C5). The function counts numbers across all ranges.
How do I count non-empty cells in Google Sheets? Use =COUNTA(range) to count all cells that are not empty, regardless of type.
Is there a way to count cells that contain text? Use =COUNTIF(range, "*") to count cells with any text, or =COUNTA(range)-COUNT(range) to count non-numeric non-empty cells.
Does COUNT work in Excel the same way? Yes, the syntax and behavior are essentially identical in Microsoft Excel. The main difference is that Excel’s COUNT function is in the Statistical category, but you type it the same way.
Related
- Windows Shortcut for CMD: Quick Keys & How to Use Them
- Formal Invoice Template Excel: How to Make One
- Google Sheets Query Join Two Tables: How To
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Formulas & functions
- Combine SUMIF and SUBTOTAL in ExcelCombining SUMIF and SUBTOTAL lets you sum values that meet a condition (like a product category or region)…
- Traffic Light Sensor Camera: How It Works & If It Tickets YouTraffic light sensor cameras are devices mounted at intersections that detect vehicles waiting at a red light and…
- Excel LET Function: Make Advanced Formulas ClearerYes—Excel lets you build advanced formulas, and the LET function makes them easier to read by giving names…
- Unique Excel Formula With Multiple Criteria: How It WorksTo return distinct values that meet multiple conditions in Excel for Microsoft 365, combine UNIQUE with FILTER. With…
- Excel Formula for Percent Change CalculationWith the original value in B2 and the new value in C2, enter =(C2-B2)/B2 in D2 to calculate…
- How to Use the FV Function in Excel: Examples and TipsIn Excel, use the FV function to calculate the future value of an investment or a series of…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.