COUNTA Function (LibreOffice Calc)
The COUNTA function in LibreOffice Calc counts non‑empty cells, including text, numbers, logical values, and formulas. This guide explains syntax, examples, edge cases, errors, and best practices.
Compatibility
▾| Excel | ✔ |
| Gnumeric | ✔ |
| Google_sheets | ✔ |
| Libreoffice | ✔ |
| Numbers | ✖ |
| Onlyoffice | ✔ |
| Openoffice | ✔ |
| Wps | ✔ |
| Zoho | ✔ |
What the COUNTA Function Does ▾
- Counts any non‑empty cell
- Counts text, numbers, logical values, formulas, and errors
- Ignores only truly empty cells
- Works with ranges, references, and mixed arguments
- Supports multiple ranges
- Works across sheets
- Handles large datasets efficiently
COUNTA is ideal for determining how many cells contain anything at all.
Syntax ▾
COUNTA(value1; value2; ...)
;) to separate arguments, not commas.
COUNT, which counts only numbers.
Basic Examples ▾
Count non‑empty cells in a range
=COUNTA(A1:A10)
Counts all cells that contain text, numbers, formulas, or errors.
Count non‑empty cells in multiple ranges
=COUNTA(A1:A10; C1:C10)
Count mixed values
=COUNTA(5; "Hello"; ""; 0; TRUE)
Result: 4
(Empty string "" counts as empty.)
Count formulas even if they return empty text
=COUNTA(A1:A10)
Cells containing formulas like ="" are counted as non‑empty.
Advanced Examples ▾
Count non‑empty cells across sheets
=COUNTA(Sheet1.A1:A10; Sheet2.B1:B10)
Count non‑empty cells using 3D references
LibreOffice supports 3D ranges:
=COUNTA(Sheet1:Sheet5.A1)
Counts how many A1 cells across five sheets contain any content.
Count only visible cells (filtered data)
LibreOffice Calc does not have a COUNTA_VISIBLE function, but you can use:
=SUBTOTAL(103; A1:A10)
Function code 103 means COUNTA.
Count cells that contain text only
Use COUNTIF:
=COUNTIF(A1:A10; "<>")
This excludes empty cells and counts only text or text‑like values.
Count cells that contain formulas
Use:
=SUMPRODUCT(NOT(ISFORMULA(A1:A10))=FALSE)
(Advanced technique for auditing spreadsheets.)
Common Errors and Fixes ▾
COUNTA returns a higher number than expected
Possible causes:
- Cells contain formulas returning empty strings (
="") - Cells contain spaces
- Cells contain invisible characters (common in pasted data)
- Cells contain error values
Fix:
Use TRIM or CLEAN, or inspect cells with:
=LEN(A1)
COUNTA returns 0 unexpectedly
Possible causes:
- Range contains only truly empty cells
- Imported data interpreted as empty strings
Fix: Convert imported text:
Data → Text to Columns → OK
Err:504 — Parameter error
Occurs when:
- A range reference is malformed
- A non‑range argument is incorrectly formatted
Best Practices ▾
- Use COUNTA to count any non‑empty cell
- Use
COUNTwhen counting only numbers - Use
COUNTBLANKto count empty cells - Use
COUNTIFSfor conditional counting - Clean imported data before analysis
- Use named ranges for cleaner formulas
Example:
=COUNTA(Employee_Records)