{
  "category": "Statistical functions",
  "display_name": "COUNTA",
  "entry_kind": "built_in_function",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.COUNTA",
  "implementation_state": {
    "answer_bank": {
      "excel_builds": [
        "20430"
      ],
      "larger_numeric": 0,
      "last_bit": 0,
      "matched": 1212,
      "other_mismatch": 0,
      "refused": 0,
      "rows": 1212,
      "unread": 0,
      "worst_ulp": 0
    },
    "detail": "Recorded: 1,212 in the answer bank and 22 workbook cells.",
    "dnacalc_commit": "9e1884369a678158dd82d3d74188daf986995e87",
    "in_catalogue": true,
    "state": "matches",
    "state_label": "Matches every recorded Excel answer",
    "summary": "Matches all 1,234 recorded answers",
    "workbook_corpus": {
      "cells": 23,
      "matched": 22,
      "pending": 1
    }
  },
  "implementations": [
    {
      "commit": "9e1884369a678158dd82d3d74188daf986995e87",
      "flavour": "excel-compatibility-candidate",
      "language": "Rust",
      "name": "CalcFunc",
      "own_code": [
        "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/aggregate.rs#L101-L101",
        "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/aggregate.rs#L395-L425"
      ],
      "repository": "https://github.com/DnaCalc/DnaCalc",
      "shared_code": [
        "catalogue/aggregate::aggregate",
        "catalogue/aggregate::finite",
        "catalogue/aggregate::holds_held_arrays",
        "catalogue/aggregate::read_through_held_arrays",
        "catalogue/aggregate::flatten",
        "catalogue/aggregate::read_held_references",
        "catalogue/aggregate::each_value",
        "catalogue/aggregate::read_values",
        "catalogue/aggregate::reader",
        "catalogue/aggregate::read_reference"
      ],
      "source": "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/aggregate.rs#L101-L101",
      "state": "matches",
      "suite": null,
      "summary": "Matches all 1,234 recorded answers"
    }
  ],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.COUNTA.json",
  "name": "COUNTA",
  "notes": [],
  "schema": "efh.function-reference/v1",
  "section_order": [
    "what-it-does",
    "try-it",
    "quirks",
    "how-to-implement",
    "version-differences",
    "alternatives"
  ],
  "sections": {
    "alternatives": "\n### Relationships\n\n\n- **`COUNT`** — the numeric-only counterpart, and the comparison Microsoft's own page\n  draws: use `COUNT` if you do not need to count logical values, text, or error values. `COUNT`\n  applies a coercion policy; `COUNTA` applies a classification. On a clean numeric column they\n  agree; on any real column they do not, and the difference is the diagnostic.\n- **[COUNTBLANK](FUNC.COUNTBLANK.md)** — the complement, except that it is not a complement. Both\n  count a cell holding `\"\"`. See the arithmetic note above.\n- **`COUNTIF` / `COUNTIFS`** — the conditional counters\n  Microsoft's page points to. Note that `COUNTIF(range,\"<>\")` is *not* a `COUNTA` substitute: it\n  runs the criteria matcher with its own blank-handling rules rather than the non-emptiness\n  predicate.\n- **`ROWS`/`COLUMNS`** — the shape questions. `ROWS(r)*COLUMNS(r) − COUNTA(r)` counts truly empty\n  cells and is not the same as `COUNTBLANK(r)`, again because of empty text.\n- **Confused with**: `COUNTA` as a data-quality measure. A column of `#N/A` is fully populated\n  according to `COUNTA`.\n\n\n",
    "how-to-implement": "\n### Notes for implementers\n\n2. **Empty text is text.** A zero-length string is a Text value and counts. This is the rule most\n   often got wrong, and it must be decided at the value-kind level, not by asking whether the string\n   renders as something.\n3. **Do not fold errors.** An incoming error is a value to count, not a result to propagate. This is\n   an explicit per-family exception to the universal error-propagation discipline\n   ([chapter 02](../model/02-coercion-and-lifting.md)) and needs to be declared, not inherited.\n4. **Distinguish Missing from Empty at the boundary even though they agree here.** They agree for\n   `COUNTA` and disagree for other members of the counting cluster; conflating them upstream makes\n   the other functions unimplementable.\n\n\n",
    "quirks": "\n### Result and edge cases\n\n\nReturns `Number` — a non-negative integer count. It never returns an error on account of the data.\n\n- **`COUNTA()` of a range with nothing in it** is `0`, not an error.\n- **Direct arguments versus scanned cells.** `COUNTA(\"\")` and a cell containing `\"\"` are both\n  counted, so unlike the aggregates `COUNTA` shows no direct-versus-scan asymmetry\n  ([chapter 02](../model/02-coercion-and-lifting.md)). That is a consequence of the predicate never\n  attempting a coercion at all.\n\nThe value kind returned is always Number even when nothing was counted, so `ISNUMBER(COUNTA(...))`\nis always `TRUE` and cannot be used as a guard.\n\n\n\n### Errors\n\n\n`COUNTA` has no documented data-dependent error conditions — that is the point of it.\n\n",
    "sources": "- Handbook call-model chapters [01 The value universe](../model/01-value-universe.md) (value kinds,\n  Missing versus Empty, the fourteen error codes) and\n  [02 Coercion and lifting](../model/02-coercion-and-lifting.md) (error propagation as a per-family\n  declaration; the direct-argument versus range-scan distinction).\n- Handbook projections `data/functions/FUNC.COUNTA.json` (arity, `ReductionFold` error-collapse\n  profile, aggregate dual policy) and `data/presence/FUNC.COUNTA.json`.\n\n\n",
    "version-differences": "The recorded environments below distinguish a reading from a same-input comparison. Counts describe captured inputs in each environment; overlapping captures and comparisons are not totals of unique worksheet calls.\n\n| Excel 16.0 build | Platform and CPU | Captured inputs |\n|---|---|---:|\n| 20430 | Windows, 64-bit, CPU not recorded | 1,212 |\n\nThe record contains no same-input comparison between these environments. Reading different inputs on different builds does not establish either a version change or cross-build agreement.\n\n[Recorded environments and comparison details](https://github.com/DnaCalc/ExcelFunctionsHandbook/blob/5dc75391aa5125ccc5abdb095da85950980d6fd8/content/evidence/environments/FUNC.COUNTA.json).",
    "what-it-does": "\n`COUNTA(value1, [value2], …)` counts the arguments and scanned cells that are **not empty**.\n\nThe predicate is a single question asked of each value: *is anything here?* It is not \"is this a\nnumber\", not \"does this coerce to a number\", and not \"does this display something\". Microsoft's\npage states it as counting cells containing any type of information, \"including error values and\nempty text\" — and, explicitly, not counting truly empty cells.\n\nThat gives the following classification, which is the whole function:\n\n| Value | Counted? |\n|---|---|\n| Number, including `0` | yes |\n| Text, including the empty string `\"\"` | yes |\n| Logical `TRUE` / `FALSE` | yes |\n| Error value, e.g. `#DIV/0!` | yes |\n| A formula that returns `\"\"` | yes — the cell contains a formula |\n| A genuinely empty cell | no |\n| An omitted argument slot | no |\n\nTwo consequences are worth stating because they are where readers are surprised.\n\n**`COUNTA` counts errors.** It is the only common counting function that does. This is what makes\n`COUNTA` useful as a \"how many cells have been filled in\" measure and useless as a \"how much good\ndata do I have\" measure. `COUNT` answers the second question.\n\n**`COUNTA` counts empty text.** A cell holding `=IF(A1>0,\"x\",\"\")` is counted whether or not the\ncondition held, because the cell holds a formula and the formula published a text value — a\nzero-length one. This is the single most common cause of `COUNTA` disagreeing with what a human sees\non the screen, and it is documented. Its mirror image is [COUNTBLANK](FUNC.COUNTBLANK.md), which\ncounts `\"\"` as blank; the two functions therefore both count the same cell, and\n`COUNTA(r) + COUNTBLANK(r)` exceeds the cell count of `r` by the number of empty-text cells. That\nis not a defect in either function — it is the documented consequence of two different definitions\nof \"blank\" living in one product.\n\n\n\n### Arguments\n\n| Argument | Meaning | Optional |\n|---|---|---|\n| `value1` | The first value, range, array or reference to examine | no |\n| `value2`, … | Up to 254 further such arguments | yes |\n\nThe commonly misunderstood position is that there isn't one — every position behaves identically.\nWhat *does* differ is how a value arrives. An omitted slot (`COUNTA(1,,2)`) delivers the Missing\nmarker and contributes nothing; an empty *cell* reached through a range delivers Empty and likewise\ncontributes nothing. The two are different kinds arriving by different routes at the same answer\nhere ([chapter 01](../model/01-value-universe.md)), and `COUNTA` is one of the few functions where\nthey agree.\n\n\n"
  },
  "signature": {
    "display": "COUNTA(value1, [value2], ...)",
    "parameters": [
      {
        "description": null,
        "name": "value1",
        "optional": false,
        "repeats": false
      },
      {
        "description": null,
        "name": "value2",
        "optional": true,
        "repeats": true
      }
    ],
    "trailing_repeats": true
  },
  "sources": {
    "metadata": {
      "admission": {
        "label": "implemented",
        "reason": null
      },
      "arity": {
        "max": 255,
        "min": 1
      },
      "category": "Statistical functions",
      "classification": {
        "arg_preparation_profile": "ValuesOnlyPreAdapter",
        "coercion_lift_profile": "AggregateDirectAndRangeDualPolicy",
        "determinism_class": "Deterministic",
        "error_collapse_profile": "ReductionFold",
        "fec_dependency_profile": "None",
        "host_interaction_class": "None",
        "kernel_signature_class": "NumsToNum",
        "rich_value_usage": "RichBlind",
        "surface_fec_dependency_profile": "RefOnly",
        "thread_safety_class": "SafePure",
        "volatility_class": "NonVolatile"
      },
      "descriptions": {
        "long": null,
        "short": "How many of the values are not empty",
        "short_source": "dna-calc-own"
      },
      "docs": {
        "english_description": "Counts how many values are in the list of arguments",
        "microsoft_url": "https://support.microsoft.com/en-us/office/counta-function-7dc98875-d5c1-46f1-9a82-53f3219e2509"
      },
      "entry_kind": "built_in_function",
      "localized_family_names": null,
      "localized_names": [
        {
          "locale": "ar-SA",
          "name": "COUNTA"
        },
        {
          "locale": "bg-BG",
          "name": "COUNTA"
        },
        {
          "locale": "cs-CZ",
          "name": "POČET2"
        },
        {
          "locale": "da-DK",
          "name": "TÆLV"
        },
        {
          "locale": "de-DE",
          "name": "ANZAHL2"
        },
        {
          "locale": "el-GR",
          "name": "COUNTA"
        },
        {
          "locale": "en-AU",
          "name": "COUNTA"
        },
        {
          "locale": "en-GB",
          "name": "COUNTA"
        },
        {
          "locale": "en-US",
          "name": "COUNTA"
        },
        {
          "locale": "es-ES",
          "name": "CONTARA"
        },
        {
          "locale": "et-EE",
          "name": "COUNTA"
        },
        {
          "locale": "fi-FI",
          "name": "LASKE.A"
        },
        {
          "locale": "fr-FR",
          "name": "NBVAL"
        },
        {
          "locale": "he-IL",
          "name": "COUNTA"
        },
        {
          "locale": "hr-HR",
          "name": "COUNTA"
        },
        {
          "locale": "hu-HU",
          "name": "DARAB2"
        },
        {
          "locale": "id-ID",
          "name": "COUNTA"
        },
        {
          "locale": "it-IT",
          "name": "CONTA.VALORI"
        },
        {
          "locale": "ja-JP",
          "name": "COUNTA"
        },
        {
          "locale": "ko-KR",
          "name": "COUNTA"
        },
        {
          "locale": "lt-LT",
          "name": "COUNTA"
        },
        {
          "locale": "lv-LV",
          "name": "COUNTA"
        },
        {
          "locale": "nb-NO",
          "name": "ANTALLA"
        },
        {
          "locale": "nl-NL",
          "name": "AANTALARG"
        },
        {
          "locale": "pl-PL",
          "name": "ILE.NIEPUSTYCH"
        },
        {
          "locale": "pt-BR",
          "name": "CONT.VALORES"
        },
        {
          "locale": "pt-PT",
          "name": "CONTAR.VAL"
        },
        {
          "locale": "ro-RO",
          "name": "COUNTA"
        },
        {
          "locale": "ru-RU",
          "name": "СЧЁТЗ"
        },
        {
          "locale": "sk-SK",
          "name": "COUNTA"
        },
        {
          "locale": "sl-SI",
          "name": "COUNTA"
        },
        {
          "locale": "sr-Latn-RS",
          "name": "COUNTA"
        },
        {
          "locale": "sv-SE",
          "name": "ANTALV"
        },
        {
          "locale": "th-TH",
          "name": "COUNTA"
        },
        {
          "locale": "tr-TR",
          "name": "BAĞ_DEĞ_DOLU_SAY"
        },
        {
          "locale": "uk-UA",
          "name": "COUNTA"
        },
        {
          "locale": "vi-VN",
          "name": "COUNTA"
        },
        {
          "locale": "zh-CN",
          "name": "COUNTA"
        },
        {
          "locale": "zh-HK",
          "name": "COUNTA"
        },
        {
          "locale": "zh-TW",
          "name": "COUNTA"
        }
      ],
      "signature": {
        "display": "COUNTA(value1, [value2], ...)",
        "parameters": [
          {
            "description": null,
            "name": "value1",
            "optional": false,
            "repeats": false
          },
          {
            "description": null,
            "name": "value2",
            "optional": true,
            "repeats": true
          }
        ],
        "trailing_repeats": true
      },
      "surface_name": "COUNTA",
      "version_marker": null,
      "xlcall": {
        "code": "169",
        "symbol": "xlfCounta"
      }
    },
    "microsoft": "https://support.microsoft.com/en-us/office/counta-function-7dc98875-d5c1-46f1-9a82-53f3219e2509"
  },
  "try_it": {
    "formula": "=COUNTA(1,,2)"
  },
  "url": "https://handbook.dnacalc.com/functions/COUNTA.html",
  "variants": [],
  "versions": [
    {
      "behaviour": "1,212 captured inputs are indexed for this environment. Capture dates: 2026-09-29 to 2026-09-29. This is a reading count, not a comparison with another build.",
      "excel_build": "16.0 build 20430",
      "platform": "Windows, 64-bit, CPU not recorded",
      "sources": [
        "https://github.com/DnaCalc/ExcelFunctionsHandbook/blob/5dc75391aa5125ccc5abdb095da85950980d6fd8/content/evidence/environments/FUNC.COUNTA.json"
      ]
    }
  ]
}