Contact

COUNTA Function (LibreOffice Calc)

Math Beginner LibreOffice Calc LibreOffice 3.0

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.

Verification status: Consult the documentation and examples below. Native application testing has not been documented for this guide. How formula examples are checked

The **COUNTA** function counts all non‑empty cells, including text, numbers, logical values, formulas, and error values. It is essential for validating datasets, checking completeness, and analyzing mixed‑type data in LibreOffice Calc.

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; ...)
LibreOffice Calc uses semicolons (;) to separate arguments, not commas.
COUNTA counts text, unlike 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.

COUNTA can accept up to 255 arguments, including ranges, values, and references.

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 COUNT when counting only numbers
  • Use COUNTBLANK to count empty cells
  • Use COUNTIFS for conditional counting
  • Clean imported data before analysis
  • Use named ranges for cleaner formulas
Named ranges make formulas easier to read and maintain.
Example: =COUNTA(Employee_Records)

Reproducible example (tested in LibreOffice Calc)

This standalone example was calculated in LibreOffice Calc 25.2.3.2 and matched the expected value. It is a practical cross-check of one usage, not proof that every example elsewhere on this page is correct.

=COUNTA("A";"B";2)

Expected result: 3.

Count nonempty values, whether text or numeric.

If the result differs, check the referenced cells, argument separators and number formatting. For more information, consult the LibreOffice Calc official help.