# How to count cells that are not blank in Excel

Use =COUNTA(range). It counts every cell that has anything in it: numbers, text, dates and errors.

**Excel:** `=COUNTA(C2:C8)` (Every current version)

**Google Sheets:** the same formula works.

## Example

Sample data (row 1 is the header):

| A | B | C | D | E | F |
| --- | --- | --- | --- | --- | --- |
| Student | Assignment 1 | Assignment 2 | Assignment 3 |  | Submitted for 2 |
| Ava | 2026-09-08 | 2026-09-22 |  |  |  |
| Ben | 2026-09-09 |  | 2026-10-06 |  |  |
| Chloe | 2026-09-08 | 2026-09-21 | 2026-10-05 |  |  |
| Dan |  | 2026-09-23 |  |  |  |
| Eve | 2026-09-10 |  | 2026-10-07 |  |  |
| Finn | 2026-09-08 | 2026-09-22 | 2026-10-06 |  |  |
| Gia | 2026-09-11 | 2026-09-24 |  |  |  |

Formula in G1: `=COUNTA(C2:C8)`

Result: 5

## How it works

COUNTA counts cells that are not empty, whatever they contain. COUNT would also work here because dates are numbers, but COUNTA is the general answer: it counts text too.

## Other ways

- `=ROWS(C2:C8)-COUNTBLANK(C2:C8)`: Rows minus blanks gives the same count. COUNTBLANK also counts formulas that return "".
- `=COUNTIF(C2:C8,"<>")`: COUNTIF with "not equal to nothing" is handy when you need it inside COUNTIFS with other conditions.

## Common mistakes

- A cell with a formula that returns "" looks empty but COUNTA counts it. Use `=SUMPRODUCT(--(C2:C8<>""))` to skip those too.
- A cell with a single space is not blank. TRIM the data or count with `=SUMPRODUCT(--(TRIM(C2:C8)<>""))`.

## Questions

**What is the difference between COUNT and COUNTA?**

COUNT counts only numbers (and dates, which are numbers). COUNTA counts every non-empty cell, including text and errors.

**How do I count blank cells instead?**

Use `=COUNTBLANK(C2:C8)`.

Every formula and result on this page was checked by running it in the Spreadsheet Practice formula engine on 2026-10-29.

Source: https://spreadsheetpractice.com/formulas/count-cells-that-are-not-blank
