The quickest way to count cells in Google Sheets is with the COUNTA function for non-empty cells, COUNT for numbers, and COUNTIF for cells that match a condition. For example, =COUNTA(A2:A100) returns the number of cells in that range that contain any value, including text and errors.
What Exactly Does “Counter” Mean in Google Sheets?
People search “Google spreadsheet counter” for a few different tasks. Most often they want to count how many cells are filled, count rows that meet a condition, or build a live tally that updates as data is added. Google Sheets has dedicated functions for each of these, and the right one depends on what you are counting and what counts as a “hit.”
- Count all non-empty cells:
COUNTA - Count only numeric cells:
COUNT - Count cells that match a condition:
COUNTIFandCOUNTIFS - Count unique values:
COUNTUNIQUEandCOUNTUNIQUEIFS - Count blank cells:
COUNTBLANK
If you are building a live counter that increments when a checkbox is ticked or a dropdown changes, you combine these with IF or use a built-in feature like the status column in a checklist.
How to Count Cells with Formulas
Assume you have a list of sales amounts in cells B2:B50 and you want to know how many sales were recorded. Use =COUNT(B2:B50). This returns the number of cells in that range that contain numbers. If some cells contain text like “N/A” or are blank, COUNT ignores them.
To count every cell that has any content at all, including text, numbers, or even a space, use =COUNTA(B2:B50). This is the most common “counter” because it answers “how many rows have data?”
For a condition, say you want to count how many sales were over $100. With the amounts in B2:B50, enter =COUNTIF(B2:B50, ">100"). The result is the number of cells meeting that condition. For multiple conditions, such as sales over $100 in the East region (region in A2:A50), use =COUNTIFS(B2:B50, ">100", A2:A50, "East").
All these formulas recalculate automatically when you edit the sheet, so they act as live counters.
Using Checkboxes as a Visual Counter
A common request is a checklist where each completed item adds to a tally. In Google Sheets, you can insert checkboxes by selecting a range and choosing Insert > Checkbox. The cells then contain TRUE when checked and FALSE when unchecked.
To count how many checkboxes are checked, use =COUNTIF(C2:C20, TRUE) if your checkboxes are in C2:C20. For a percentage of completion, divide by the total number of items: =COUNTIF(C2:C20, TRUE)/COUNTA(A2:A20) and format the cell as a percentage.
This approach is widely used for to-do lists, inventory tracking, and attendance sheets.
Counting Unique Values
If you need to know how many distinct items appear in a list, use =COUNTUNIQUE(A2:A100). This counts each unique value once, ignoring blanks. For example, if column A lists product names and some appear multiple times, this gives the number of different products.
For a conditional unique count, use COUNTUNIQUEIFS. Suppose you have products in A2:A100 and regions in B2:B100, and you want the number of unique products sold in the East. The formula is =COUNTUNIQUEIFS(A2:A100, B2:B100, "East").
Note that COUNTUNIQUE is a Google Sheets function; it does not exist in Microsoft Excel. In Excel, you would use SUMPRODUCT with COUNTIF or the newer UNIQUE function combined with COUNTA.
Counting Blank and Non-Blank Cells
Sometimes you want the opposite: how many cells are empty. Use =COUNTBLANK(A2:A100). This counts cells that are truly blank (no formula, no space). A cell with a formula that returns an empty string is not counted as blank.
To count cells that are not blank, you already have COUNTA, but be aware that COUNTA counts cells containing a formula that returns an empty string. If you need to exclude those, use =ROWS(A2:A100) - COUNTBLANK(A2:A100) or better, =SUMPRODUCT((A2:A100<>")")) which is more precise but longer.
Common Problems and How to Fix Them
One frequent issue is COUNTIF not matching text correctly. The function is case-insensitive by default, so “east” and “East” match. If you need case-sensitive matching, use SUMPRODUCT with EXACT: =SUMPRODUCT(--EXACT(A2:A50, "East")).
Another problem is counting cells that contain a substring. For example, you want to count cells in A2:A50 that contain the word “apple” anywhere. Use =COUNTIF(A2:A50, "*apple*"). The asterisks are wildcards. For a literal question mark or asterisk, escape them with a tilde (~) in the criteria.
If your counter returns 0 when you expect a number, check that the range is correct and that the data type matches. Text numbers stored as text are not counted by COUNT. Convert them with VALUE() or use COUNTA instead.
Google Sheets vs. Excel for Counting
Excel has the same core functions: COUNT, COUNTA, COUNTIF, COUNTIFS, and COUNTBLANK. The main difference is that Google Sheets offers COUNTUNIQUE and COUNTUNIQUEIFS natively, while Excel requires a workaround. Also, Google Sheets formulas use commas to separate arguments (same as Excel on Windows), but in some European locales you may need semicolons.
Another difference: in Excel, you can use structured references in tables, but Google Sheets does not have formal tables. Instead, you can use named ranges (Data > Named ranges) to make formulas easier to read.
For dynamic arrays, Excel has FILTER and UNIQUE which can be combined to count unique values: =COUNTA(UNIQUE(A2:A100)). In Google Sheets, UNIQUE also exists, but COUNTUNIQUE is simpler.
Automated Counters with Scripts
If you need a counter that updates based on a timestamp or a button click, you can use Google Apps Script. For example, to count how many times a button is clicked, you would create a script that increments a value in a cell. This is beyond simple formulas but is a real use case for “counter” searches.
A simple script to increment a cell:
function incrementCounter() {
var sheet = SpreadsheetApp.getActiveSheet();
var cell = sheet.getRange("B1");
var current = cell.getValue();
cell.setValue(current + 1);
}
Attach this to a drawing or image via the script editor. Remember to save a copy of your spreadsheet before running scripts, as they cannot be undone with Ctrl+Z.
Frequently Asked Questions
How do I count rows with data in Google Sheets? Use =COUNTA(A2:A) to count all non-empty cells in column A from row 2 down. If you want to count rows where the entire row has data, use =SUMPRODUCT(--(A2:A<>"")) for a single column, or for multiple columns use =SUMPRODUCT(--(A2:A<>"")*(B2:B<>"")).
Can I count cells based on color? Not with standard functions. Google Sheets has no built-in formula to count by background color. You would need to use Google Apps Script to loop through cells and check the background color, or use a paid add-on.
Why does COUNTA count a cell with a formula that returns nothing? Because the cell contains a formula, it is not empty. If you want to ignore formulas that return an empty string, use =SUMPRODUCT((A2:A100<>"")*(A2:A100<>"")) but note that this still counts cells with formulas that return a value. The only way to exclude them is to use a script or a helper column that checks =IF(A2="","",A2).
How do I count checkboxes that are checked? Use =COUNTIF(range, TRUE). If your checkboxes are in C2:C20, that formula counts how many are checked. For unchecked, use =COUNTIF(range, FALSE).
Is there a way to count unique text values ignoring blanks? Yes, =COUNTUNIQUE(A2:A100) ignores blanks automatically. If you need to ignore only certain values, use COUNTUNIQUEIFS with a condition.
How do I count cells that contain a specific word? Use =COUNTIF(A2:A100, "*word*"). This counts cells that contain “word” anywhere. For case-sensitive, use =SUMPRODUCT(--ISNUMBER(SEARCH("word", A2:A100))) but note SEARCH is case-insensitive; use FIND for case-sensitive.
Related
- Balloon Payment Calculator: Fixed Payment Basics
- PLC Fiddle Traffic Light: How It Works & Real Uses
- Rockwell 20V Max Brushless Drill Driver Review
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Excel Before Close Event: How to Run Code on SaveYes, Excel has a Before Close event that runs VBA code just before a workbook closes. You add…
- How to Unhide Rows in Excel All at Once on WindowsTo unhide every hidden row on an Excel worksheet at once, click the Select All button at the…
- Excel Cell Repair in Clementi: Fixes and Local HelpIf you need Excel cell repair in Clementi, first identify whether the problem is a wrong formula or…
- How to Insert a Black Line in WordTo insert a black line in Word, type three hyphens on a blank line and press Enter; Word…
- How to Loop a PowerPoint Slideshow Without ClickingTo loop a PowerPoint slideshow without clicking, set the slides to advance automatically and turn on continuous looping.…
- Excel Adjusting Print Area: Fit, Set, and Clear PagesTo adjust a print area in Excel for Microsoft 365 on Windows, select the cells you want, then…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.