# COUNTA formula generator

> Describe what you need and get a COUNTA formula for Excel and Google Sheets, run on real data before you copy it. Plus 8 tested COUNTA examples.

Source: https://spreadsheetpractice.com/tools/formula-generator/counta · Updated October 29, 2026 · Formulas and results on this page were run by the Spreadsheet Practice formula engine on November 20, 2026

COUNTA counts every cell that isn't empty: text, numbers, dates, errors and even formulas that return empty text.

Describe the task at [COUNTA formula generator](https://spreadsheetpractice.com/tools/formula-generator/counta) and get a COUNTA formula for Excel and Google Sheets, tested on real data.

## Tested COUNTA examples

### Count cells that are not blank

`=COUNTA(C2:C8)`

Excel. Result on the sample sheet: 5. [See it and try it](https://spreadsheetpractice.com/formulas/count-cells-that-are-not-blank)

### Number rows automatically

`=SEQUENCE(COUNTA(B2:B30))`

Excel. Result on the sample sheet: 8 rows (A2:A9). [See it and try it](https://spreadsheetpractice.com/formulas/number-rows-automatically)

### Calculate the percentage of each answer in a survey

`=COUNTIF($B$2:$B$16,E2)/COUNTA($B$2:$B$16)`

Excel. Result on the sample sheet: 5 rows (F2:F6). [See it and try it](https://spreadsheetpractice.com/formulas/percentage-of-each-answer)

### Check if a range of cells is empty

`=IF(COUNTA(B2:E2)=0,"No response","Answered")`

Excel. Result on the sample sheet: 5 rows (F2:F6). [See it and try it](https://spreadsheetpractice.com/formulas/check-if-a-range-is-empty)

### Count unique values

`=COUNTA(UNIQUE(A2:A10))`

Excel. Result on the sample sheet: 5. [See it and try it](https://spreadsheetpractice.com/formulas/count-unique-values)

### Calculate attendance percentage

`=COUNTIF(B2:G2,"P")/COUNTA(B2:G2)`

Excel. Result on the sample sheet: 6 rows (H2:H7). [See it and try it](https://spreadsheetpractice.com/formulas/attendance-percentage)

### Calculate the percentage of Yes responses

`=COUNTIF(B2:B13,"Yes")/COUNTA(B2:B13)`

Excel. Result on the sample sheet: 70.0%. [See it and try it](https://spreadsheetpractice.com/formulas/percentage-of-yes-responses)

### Count unique values with criteria

`=COUNTA(UNIQUE(FILTER(A2:A13,B2:B13=G1)))`

Excel. Result on the sample sheet: 5. [See it and try it](https://spreadsheetpractice.com/formulas/count-unique-values-with-criteria)

## Questions

### What does the COUNTA formula generator do?

You describe the task in plain English, and it writes the formula, using COUNTA where that's the right tool, for your table or a sample one. The formula is run in our engine in Excel and Google Sheets mode before you see it, so you get its result, not just a guess.

### What does COUNTA do?

COUNTA counts every cell that isn't empty: text, numbers, dates, errors and even formulas that return empty text.

### Can I learn to write COUNTA formulas myself?

Yes. Each example below opens a page where you try the formula in a live grid and it's checked as you go, and the COUNTA function page has a practice exercise.

---

Spreadsheet Practice (https://spreadsheetpractice.com) teaches spreadsheet formulas by practice: every exercise is graded in a live grid and re-checked on changed data.
