Counting blanks and entries: practice exercises
COUNT, COUNTA, COUNTBLANK, COUNTIF "*". 4 exercises on real-looking data, each marked the moment you press Check. The first exercise is below to try now; the full lesson is part of Pro.
Staff were asked whether they're coming to the away day. In H1, count how many haven't replied yet (their box in column B is empty).
| A | B | C | D | E | F | G | H | |
|---|---|---|---|---|---|---|---|---|
| 1 | Employee | Coming to the away day? | Rating out of 10 | Not replied | ||||
| 2 | Ivan | Maybe | 3 | |||||
| 3 | Hamza | Yes | 7 | |||||
| 4 | Ella | |||||||
| 5 | Nadia | Yes | 9 | |||||
| 6 | Hannah | |||||||
| 7 | Ollie | Maybe | 1 | |||||
| 8 | Sunil | |||||||
| 9 | Maria | |||||||
| 10 | Owen | Yes | 5 | |||||
| 11 | Lucy | |||||||
| 12 | Tom | Maybe | not sure | |||||
| 13 | Chen | No | n/a | |||||
| 14 | Jess | Yes | 3 | |||||
| 15 | Ben | Maybe | 5 | |||||
| 16 | Pippa | No | 9 | |||||
| 17 | Zoe | |||||||
| 18 | Nia | No | 2 | |||||
| 19 | Dev | Yes | ||||||
| 20 | Priya | Maybe | n/a | |||||
| 21 | Sam |
How it works
COUNT counts the cells with numbers in. COUNTA counts every cell that isn't empty: numbers, text, anything. COUNTBLANK counts the empty ones.
To count only the text entries, take COUNT away from COUNTA, or use COUNTIF(range,"*"): the * wildcard matches any text.
=COUNT(C2:C6) =COUNTA(B2:B6) =COUNTBLANK(B2:B6) =COUNTIF(C2:C6,"*")
Three ways to count
COUNT(range): cells holding a number (dates count as numbers).COUNTA(range): cells that aren't empty, whatever is in them.COUNTBLANK(range): cells that are empty.
In a range of typed values, COUNTA plus COUNTBLANK adds up to the number of cells in the range. A formula that gives an empty result, "", is counted by both.
Worked example
| A | B | C | |
|---|---|---|---|
| 1 | Name | Reply | Rating |
| 2 | Amira | Yes | 8 |
| 3 | Ben | ||
| 4 | Cara | No | n/a |
| 5 | Dev | Yes | 6 |
| 6 | Ewa |
=COUNT(C2:C6)in E2. Only Amira and Dev gave a number, so COUNT gives 2. Cara's n/a is text.=COUNTA(C2:C6)in E3. COUNTA counts the n/a as well: 3.=COUNTBLANK(C2:C6)in E4. Ben and Ewa left it empty: 2.
Counting just the text
Take the numbers away from all the entries: COUNTA(C2:C6)-COUNT(C2:C6).
Or let a wildcard do it: COUNTIF(C2:C6,"*") counts cells holding any text at all.
What you'll practise
- Staff were asked whether they're coming to the away day. In H1, count how many haven't replied yet (their box in column B is empty).
- Some people gave a rating and some wrote a comment instead, such as n/a. In H1, count how many people put anything in column C.
- In H1, count how many people wrote text in column C instead of giving a number.
- In H1, work out the response rate: the number who have replied in column B, divided by the number of people on the list. H1 is formatted as a percentage.
Guides with worked examples: Count cells with text, numbers or blanks in Excel · MO-210 Excel Associate (Microsoft 365): practice and checklist · MO-200 Excel Associate (Excel 2019): practice and checklist · COUNTIF and COUNTIFS: counting rows that match · Count unique values in Excel